mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-09 10:09:23 +02:00
Fix for Mantis #29609.
pexpr.pas, factor.factor_read_id: * don't use a cloadvmtaddrnode for accessing class properties in records + added test git-svn-id: trunk@33110 -
This commit is contained in:
parent
1945bf64b4
commit
25744dd3f1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14937,6 +14937,7 @@ tests/webtbs/tw2953.pp svneol=native#text/plain
|
||||
tests/webtbs/tw29546.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2956.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2958.pp svneol=native#text/plain
|
||||
tests/webtbs/tw29609.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2966.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2975.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2976.pp svneol=native#text/plain
|
||||
|
@ -3093,7 +3093,11 @@ implementation
|
||||
{ it as a class member }
|
||||
if (assigned(current_structdef) and (current_structdef<>hdef) and is_owned_by(current_structdef,hdef)) or
|
||||
(assigned(current_procinfo) and current_procinfo.get_normal_proc.procdef.no_self_node) then
|
||||
p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
|
||||
begin
|
||||
p1:=ctypenode.create(hdef);
|
||||
if not is_record(hdef) then
|
||||
p1:=cloadvmtaddrnode.create(p1);
|
||||
end
|
||||
else
|
||||
p1:=load_self_node;
|
||||
{ not srsymtable.symtabletype since that can be }
|
||||
|
22
tests/webtbs/tw29609.pp
Normal file
22
tests/webtbs/tw29609.pp
Normal file
@ -0,0 +1,22 @@
|
||||
{ %NORUN }
|
||||
|
||||
{$mode objfpc}
|
||||
{$MODESWITCH AdvancedRecords}
|
||||
program tw29609;
|
||||
|
||||
|
||||
type t = record
|
||||
class var v : Boolean;
|
||||
class function f : Boolean; static;
|
||||
class property p : Boolean read v;
|
||||
end;
|
||||
|
||||
|
||||
class function t.f : Boolean;
|
||||
begin
|
||||
Result := p; // "Error: Pointer to object expected"
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user