From aef6120438e6ba4efe0391b6c8ed005094e14431 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 26 Dec 2015 20:01:06 +0000 Subject: [PATCH] * 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 - --- compiler/ncgcon.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/ncgcon.pas b/compiler/ncgcon.pas index 1429bfd286..436ff5516b 100644 --- a/compiler/ncgcon.pas +++ b/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)))