Skip to content
  • Sven/Sarah Barth's avatar
    Fix for Mantis #26177. Use the correct value for the method data when using a... · 441e6c60
    Sven/Sarah Barth authored
    Fix for Mantis #26177. Use the correct value for the method data when using a method pointer of a type or record helper.
    
    Please note that Delphi has the exact same bug as we have and thus code working in FPC will not work in Delphi.
    Additionally taking the method address of a local variable or a local/global constant for a method pointer is dangerous as the variable (in case of constants is a temporary local variable) will go out of scope once the containing procedure/function/method exits!
    
    ncgld.pas, tcgloadnode.pass_generate_code:
      * only use the value of Self if it is an implicit pointer object (class instance) or a class reference, but not for everything else (objects, records, primitive types)
    
    +added test
    
    git-svn-id: trunk@28160 -
    441e6c60