Avoid range check error in AddNormalStringDef

This commit is contained in:
Pierre Muller 2024-01-10 23:24:24 +01:00
parent b4d4c30a45
commit 637c34571e

View File

@ -1630,12 +1630,14 @@ implementation
slen : asizeuint; slen : asizeuint;
arr : tasmlabel; arr : tasmlabel;
begin begin
{$push}
{$R-}{$Q-}
{ fix length of openshortstring } { fix length of openshortstring }
slen:=aword(def.len); slen:=aword(def.len);
if (slen=0) or if (slen=0) or
(slen>maxlen) then (slen>maxlen) then
slen:=maxlen; slen:=maxlen;
{$pop}
{ create a structure with two elements } { create a structure with two elements }
if not(tf_dwarf_only_local_labels in target_info.flags) then if not(tf_dwarf_only_local_labels in target_info.flags) then
current_asmdata.getglobaldatalabel(arr) current_asmdata.getglobaldatalabel(arr)