mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 08:09:33 +02:00
* fixed evaluation of length('') (the type of an empty string is a chararray
instead of string) (mantis #17604) git-svn-id: trunk@16128 -
This commit is contained in:
parent
2139a229d3
commit
a178ff5172
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10701,6 +10701,7 @@ tests/webtbs/tw1754c.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1755.pp svneol=native#text/plain
|
||||
tests/webtbs/tw17550.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1758.pp svneol=native#text/plain
|
||||
tests/webtbs/tw17604.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1765.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1779.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1780.pp svneol=native#text/plain
|
||||
|
@ -1711,7 +1711,12 @@ implementation
|
||||
end;
|
||||
arraydef :
|
||||
begin
|
||||
if not is_open_array(left.resultdef) and
|
||||
if (left.nodetype=stringconstn) then
|
||||
begin
|
||||
result:=cordconstnode.create(
|
||||
tstringconstnode(left).len,sinttype,true);
|
||||
end
|
||||
else if not is_open_array(left.resultdef) and
|
||||
not is_array_of_const(left.resultdef) and
|
||||
not is_dynamic_array(left.resultdef) then
|
||||
result:=cordconstnode.create(tarraydef(left.resultdef).highrange-
|
||||
|
5
tests/webtbs/tw17604.pp
Normal file
5
tests/webtbs/tw17604.pp
Normal file
@ -0,0 +1,5 @@
|
||||
program TestLength;
|
||||
begin
|
||||
if Length('') <> 0 then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user