Переглянути джерело

* fixed shortstring constant emission after r28210: the terminating #0
was no longer included, so things went wrong if the string was reused
for a pchar

git-svn-id: trunk@32738 -

Jonas Maebe 9 роки тому
батько
коміт
aef6120438
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      compiler/ncgcon.pas

+ 2 - 2
compiler/ncgcon.pas

@@ -377,9 +377,9 @@ implementation
                           move(value_str^,pc[1],l);
                           pc[0]:=chr(l);
                           pc[l+1]:=#0;
-                          datadef:=carraydef.getreusable(cansichartype,l+1);
+                          datadef:=carraydef.getreusable(cansichartype,l+2);
                           datatcb.maybe_begin_aggregate(datadef);
-                          datatcb.emit_tai(Tai_string.Create_pchar(pc,l+1),datadef);
+                          datatcb.emit_tai(Tai_string.Create_pchar(pc,l+2),datadef);
                           datatcb.maybe_end_aggregate(datadef);
                           current_asmdata.asmlists[al_typedconsts].concatList(
                             datatcb.get_final_asmlist(lastlabel.lab,datadef,sec_rodata_norel,lastlabel.lab.name,const_align(sizeof(pint)))