mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 18:59:11 +02:00
* fixed internal error when a subscripted object is used in a property
(mantis #12756) git-svn-id: trunk@12956 -
This commit is contained in:
parent
6f4637b32a
commit
624a7be9b1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8777,6 +8777,7 @@ tests/webtbs/tw12614.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw12685.pp svneol=native#text/plain
|
tests/webtbs/tw12685.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1269.pp svneol=native#text/plain
|
tests/webtbs/tw1269.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1275.pp svneol=native#text/plain
|
tests/webtbs/tw1275.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw12756.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw12788.pp svneol=native#text/plain
|
tests/webtbs/tw12788.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1279.pp svneol=native#text/plain
|
tests/webtbs/tw1279.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1283.pp svneol=native#text/plain
|
tests/webtbs/tw1283.pp svneol=native#text/plain
|
||||||
|
@ -271,7 +271,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
sl_subscript :
|
sl_subscript :
|
||||||
begin
|
begin
|
||||||
if not(assigned(def) and (def.typ=recorddef)) then
|
if not(assigned(def) and
|
||||||
|
((def.typ=recorddef) or
|
||||||
|
is_object(def))) then
|
||||||
internalerror(200402171);
|
internalerror(200402171);
|
||||||
inc(address,tfieldvarsym(hp^.sym).fieldoffset);
|
inc(address,tfieldvarsym(hp^.sym).fieldoffset);
|
||||||
def:=tfieldvarsym(hp^.sym).vardef;
|
def:=tfieldvarsym(hp^.sym).vardef;
|
||||||
|
24
tests/webtbs/tw12756.pp
Normal file
24
tests/webtbs/tw12756.pp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{$mode delphi}
|
||||||
|
{$M+}
|
||||||
|
|
||||||
|
type
|
||||||
|
TFooR = object { put "record" here and it works. }
|
||||||
|
Thing : integer;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TFoo = class
|
||||||
|
private
|
||||||
|
fRecord : TFooR;
|
||||||
|
published
|
||||||
|
property Thing : integer read fRecord.Thing;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
fFoo : TFoo;
|
||||||
|
begin
|
||||||
|
fFoo := TFoo.Create;
|
||||||
|
fFoo.fRecord.Thing:=123;
|
||||||
|
if (fFoo.Thing <> 123) then
|
||||||
|
halt(1);
|
||||||
|
fFoo.free;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user