mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-02 18:58:24 +02:00
* handle records in iso mode properly if no tag-field is given
git-svn-id: trunk@29259 -
This commit is contained in:
parent
7897c81c77
commit
dd967eb136
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11801,6 +11801,7 @@ tests/test/tisoread.pp svneol=native#text/pascal
|
||||
tests/test/tisorec1.pp svneol=native#text/pascal
|
||||
tests/test/tisorec2.pp svneol=native#text/pascal
|
||||
tests/test/tisorec3.pp svneol=native#text/pascal
|
||||
tests/test/tisorec4.pp svneol=native#text/pascal
|
||||
tests/test/tlea1.pp svneol=native#text/plain
|
||||
tests/test/tlea2.pp svneol=native#text/plain
|
||||
tests/test/tlib1a.pp svneol=native#text/plain
|
||||
|
@ -376,11 +376,13 @@ implementation
|
||||
end;
|
||||
if found then
|
||||
begin
|
||||
{ setup variant selector }
|
||||
addstatement(newstatement,cassignmentnode.create(
|
||||
csubscriptnode.create(variantselectsymbol,
|
||||
cderefnode.create(ctemprefnode.create(temp))),
|
||||
p2));
|
||||
{ if no tag-field is given, do not create an assignment statement for it }
|
||||
if assigned(variantselectsymbol) then
|
||||
{ setup variant selector }
|
||||
addstatement(newstatement,cassignmentnode.create(
|
||||
csubscriptnode.create(variantselectsymbol,
|
||||
cderefnode.create(ctemprefnode.create(temp))),
|
||||
p2));
|
||||
end
|
||||
else
|
||||
Message(parser_e_illegal_expression);
|
||||
|
23
tests/test/tisorec4.pp
Normal file
23
tests/test/tisorec4.pp
Normal file
@ -0,0 +1,23 @@
|
||||
{$mode iso}
|
||||
type
|
||||
tr = record
|
||||
l : longint;
|
||||
case integer of
|
||||
1 : (s : array[0..255] of char);
|
||||
2 : (n : integer);
|
||||
3 : (w : word; case j : integer of
|
||||
1 : (t : array[0..255] of char);
|
||||
2 : (a : integer);
|
||||
);
|
||||
end;
|
||||
pr = ^tr;
|
||||
|
||||
var
|
||||
r : pr;
|
||||
begin
|
||||
new(r,3,2);
|
||||
if r^.j<>2 then
|
||||
halt(1);
|
||||
dispose(r);
|
||||
writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user