This commit is contained in:
Ivan Bondarev 2021-12-22 20:50:03 +01:00
parent 24a40ea8c0
commit 8de0dd15b5
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,6 @@
begin
var s: string[1];
var s0: string := nil;
s := s0;
assert(s = '');
end.

View file

@ -13677,7 +13677,9 @@ end;
[System.Diagnostics.DebuggerStepThrough]
function ClipShortString(s: string; len: integer): string;
begin
if s.Length <= len then
if s = nil then
Result := ''
else if s.Length <= len then
Result := s
else Result := s.Substring(0, len);
end;