diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 9b6fd88bfc..14277730a4 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -116,11 +116,11 @@ implementation { t:=cstringdef.createlong(tordconstnode(p).value))} Message(parser_e_invalid_string_size); tordconstnode(p).value:=255; - def:=cstringdef.createshort(int64(tordconstnode(p).value)); + def:=cstringdef.createshort(int64(tordconstnode(p).value),true); end else if tordconstnode(p).value<>255 then - def:=cstringdef.createshort(int64(tordconstnode(p).value)); + def:=cstringdef.createshort(int64(tordconstnode(p).value),true); consume(_RECKKLAMMER); end; p.free; diff --git a/compiler/psystem.pas b/compiler/psystem.pas index f85d5dd2ab..fefd80b9d3 100644 --- a/compiler/psystem.pas +++ b/compiler/psystem.pas @@ -225,17 +225,17 @@ implementation bool64type:=corddef.create(bool64bit,low(int64),high(int64),true); cansichartype:=corddef.create(uchar,0,255,true); cwidechartype:=corddef.create(uwidechar,0,65535,true); - cshortstringtype:=cstringdef.createshort(255); + cshortstringtype:=cstringdef.createshort(255,true); { should we give a length to the default long and ansi string definition ?? } - clongstringtype:=cstringdef.createlong(-1); - cansistringtype:=cstringdef.createansi(0); + clongstringtype:=cstringdef.createlong(-1,true); + cansistringtype:=cstringdef.createansi(0,true); if target_info.system in systems_windows then - cwidestringtype:=cstringdef.createwide + cwidestringtype:=cstringdef.createwide(true) else - cwidestringtype:=cstringdef.createunicode; - cunicodestringtype:=cstringdef.createunicode; + cwidestringtype:=cstringdef.createunicode(true); + cunicodestringtype:=cstringdef.createunicode(true); { length=0 for shortstring is open string (needed for readln(string) } - openshortstringtype:=cstringdef.createshort(0); + openshortstringtype:=cstringdef.createshort(0,true); {$ifdef x86} create_fpu_types; {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64} diff --git a/compiler/scanner.pas b/compiler/scanner.pas index 0a55b06353..213e1e78cb 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -921,7 +921,7 @@ type sintdef:=torddef.create(s64bit,low(int64),high(int64),false); uintdef:=torddef.create(u64bit,low(qword),high(qword),false); booldef:=torddef.create(pasbool8,0,1,false); - strdef:=tstringdef.createansi(0); + strdef:=tstringdef.createansi(0,false); setdef:=tsetdef.create(sintdef,0,255); realdef:=tfloatdef.create(s80real); end; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 22810dbb92..830429dc26 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -832,15 +832,15 @@ interface encoding : tstringencoding; stringtype : tstringtype; len : asizeint; - constructor createshort(l : byte);virtual; + constructor createshort(l: byte; doregister: boolean);virtual; constructor loadshort(ppufile:tcompilerppufile); - constructor createlong(l : asizeint);virtual; + constructor createlong(l: asizeint; doregister: boolean);virtual; constructor loadlong(ppufile:tcompilerppufile); - constructor createansi(aencoding:tstringencoding);virtual; + constructor createansi(aencoding: tstringencoding; doregister: boolean);virtual; constructor loadansi(ppufile:tcompilerppufile); - constructor createwide;virtual; + constructor createwide(doregister: boolean);virtual; constructor loadwide(ppufile:tcompilerppufile); - constructor createunicode;virtual; + constructor createunicode(doregister: boolean);virtual; constructor loadunicode(ppufile:tcompilerppufile);virtual; function getcopy : tstoreddef;override; function stringtypname:string; @@ -1194,7 +1194,7 @@ implementation else symtable:=current_module.localsymtable; symtablestack.push(symtable); - current_module.ansistrdef:=cstringdef.createansi(current_settings.sourcecodepage); + current_module.ansistrdef:=cstringdef.createansi(current_settings.sourcecodepage,true); symtablestack.pop(symtable); end; result:=tstringdef(current_module.ansistrdef); @@ -2168,9 +2168,9 @@ implementation Tstringdef ****************************************************************************} - constructor tstringdef.createshort(l : byte); + constructor tstringdef.createshort(l: byte; doregister: boolean); begin - inherited create(stringdef,true); + inherited create(stringdef,doregister); stringtype:=st_shortstring; encoding:=0; len:=l; @@ -2187,9 +2187,9 @@ implementation end; - constructor tstringdef.createlong(l : asizeint); + constructor tstringdef.createlong(l: asizeint; doregister: boolean); begin - inherited create(stringdef,true); + inherited create(stringdef,doregister); stringtype:=st_longstring; encoding:=0; len:=l; @@ -2206,9 +2206,9 @@ implementation end; - constructor tstringdef.createansi(aencoding:tstringencoding); + constructor tstringdef.createansi(aencoding: tstringencoding; doregister: boolean); begin - inherited create(stringdef,true); + inherited create(stringdef,doregister); stringtype:=st_ansistring; encoding:=aencoding; len:=-1; @@ -2225,9 +2225,9 @@ implementation end; - constructor tstringdef.createwide; + constructor tstringdef.createwide(doregister: boolean); begin - inherited create(stringdef,true); + inherited create(stringdef,doregister); stringtype:=st_widestring; if target_info.endian=endian_little then encoding:=CP_UTF16LE @@ -2250,9 +2250,9 @@ implementation end; - constructor tstringdef.createunicode; + constructor tstringdef.createunicode(doregister: boolean); begin - inherited create(stringdef,true); + inherited create(stringdef,doregister); stringtype:=st_unicodestring; if target_info.endian=endian_little then encoding:=CP_UTF16LE