mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 22:28:06 +02:00
* in {$h+} mode, always treat string constants as if they were ansistrings
when determining the result of string concatenations (mantis #13456) git-svn-id: trunk@13004 -
This commit is contained in:
parent
b2607e0d83
commit
626a723f8c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8817,6 +8817,7 @@ tests/webtbs/tw13318.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1333.pp svneol=native#text/plain
|
||||
tests/webtbs/tw13343.pp svneol=native#text/plain
|
||||
tests/webtbs/tw13345x.pp svneol=native#text/plain
|
||||
tests/webtbs/tw13456.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1348.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1351.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1364.pp svneol=native#text/plain
|
||||
|
@ -1442,8 +1442,8 @@ implementation
|
||||
((cs_ansistrings in current_settings.localswitches) and
|
||||
//todo: Move some of this to longstring's then they are implemented?
|
||||
(
|
||||
is_pchar(rd) or (is_chararray(rd) and (rd.size > 255)) or is_open_chararray(rd) or
|
||||
is_pchar(ld) or (is_chararray(ld) and (ld.size > 255)) or is_open_chararray(ld)
|
||||
is_pchar(rd) or (is_chararray(rd) and (rd.size > 255)) or is_open_chararray(rd) or (lt = stringconstn) or
|
||||
is_pchar(ld) or (is_chararray(ld) and (ld.size > 255)) or is_open_chararray(ld) or (rt = stringconstn)
|
||||
)
|
||||
) then
|
||||
strtype:=st_ansistring
|
||||
|
25
tests/webtbs/tw13456.pp
Normal file
25
tests/webtbs/tw13456.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program test;
|
||||
{$ifdef fpc}
|
||||
{$mode delphi$}{$H+}
|
||||
{$endif}
|
||||
uses SysUtils;
|
||||
var
|
||||
s: string;
|
||||
s1: string[3];
|
||||
begin
|
||||
s1:='255';
|
||||
s:='This is a big long string. This is going to be '+
|
||||
'A really big long string. The idea is it needs '+
|
||||
'to be over '+s1+' characters to see if FPC can '+
|
||||
'handle it. I have a program that isn''t '+
|
||||
'building because of the '+s1+' character string '+
|
||||
'limit. I can''t imagine why I''ve run into '+
|
||||
'this now. It should be wokring just dandy. '+
|
||||
'But for some reason it wasn''t so I thought a '+
|
||||
'test program outside of the project I was '+
|
||||
'working on may be beneficial to analysis.';
|
||||
|
||||
if (length(s)<=255) then
|
||||
halt(1);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user