mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 12:59:24 +02:00
* give an error when trying to get the address of an element of a dynamic
string in a typed constant, like Delphi (instead of generating a bogus address) git-svn-id: trunk@33958 -
This commit is contained in:
parent
8bc39ba7a3
commit
b8ed0fac5d
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -10343,6 +10343,9 @@ tests/tbf/tb0248.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0249.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0250.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0251.pp svneol=native#text/pascal
|
||||
tests/tbf/tb0252a.pp svneol=native#text/plain
|
||||
tests/tbf/tb0252b.pp svneol=native#text/plain
|
||||
tests/tbf/tb0252c.pp svneol=native#text/plain
|
||||
tests/tbf/ub0115.pp svneol=native#text/plain
|
||||
tests/tbf/ub0149.pp svneol=native#text/plain
|
||||
tests/tbf/ub0158a.pp svneol=native#text/plain
|
||||
|
@ -919,7 +919,9 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
|
||||
case hp.nodetype of
|
||||
vecn :
|
||||
begin
|
||||
if is_constintnode(tvecnode(hp).right) then
|
||||
if is_constintnode(tvecnode(hp).right) and
|
||||
not is_ansistring(tvecnode(hp).left.resultdef) and
|
||||
not is_wide_or_unicode_string(tvecnode(hp).left.resultdef) then
|
||||
ftcb.queue_vecn(tvecnode(hp).left.resultdef,get_ordinal_value(tvecnode(hp).right))
|
||||
else
|
||||
Message(parser_e_illegal_expression);
|
||||
|
9
tests/tbf/tb0252a.pp
Normal file
9
tests/tbf/tb0252a.pp
Normal file
@ -0,0 +1,9 @@
|
||||
{ %FAIL }
|
||||
|
||||
const
|
||||
s : ansistring = 'test';
|
||||
|
||||
pc : pchar = @s[1];
|
||||
|
||||
begin
|
||||
end.
|
9
tests/tbf/tb0252b.pp
Normal file
9
tests/tbf/tb0252b.pp
Normal file
@ -0,0 +1,9 @@
|
||||
{ %FAIL }
|
||||
|
||||
const
|
||||
w : widestring = 'abcdef';
|
||||
|
||||
pw : pwidechar = @w[3];
|
||||
|
||||
begin
|
||||
end.
|
9
tests/tbf/tb0252c.pp
Normal file
9
tests/tbf/tb0252c.pp
Normal file
@ -0,0 +1,9 @@
|
||||
{ %FAIL }
|
||||
|
||||
const
|
||||
u : unicodestring = '123456879';
|
||||
|
||||
pu : punicodechar = @u[4];
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user