From 8ed055e4bf8dfb05d060438a4fca59dcdf28f08f Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 10 Jan 2021 14:10:52 +0000 Subject: [PATCH] --- Merging r44096 into '.': U compiler/nbas.pas --- Recording mergeinfo for merge of r44096 into '.': U . --- Merging r46274 into '.': G compiler/nbas.pas --- Recording mergeinfo for merge of r46274 into '.': G . --- Merging r48127 into '.': A tests/webtbs/tw38337.pp --- Recording mergeinfo for merge of r48127 into '.': G . git-svn-id: branches/fixes_3_2@48128 - --- .gitattributes | 1 + compiler/nbas.pas | 15 ++++++++++++++- tests/webtbs/tw38337.pp | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw38337.pp diff --git a/.gitattributes b/.gitattributes index 7f43048ba3..dd5b2b226e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17826,6 +17826,7 @@ tests/webtbs/tw38151.pp svneol=native#text/pascal tests/webtbs/tw3827.pp svneol=native#text/plain tests/webtbs/tw3829.pp svneol=native#text/plain tests/webtbs/tw3833.pp svneol=native#text/plain +tests/webtbs/tw38337.pp svneol=native#text/plain tests/webtbs/tw3840.pp svneol=native#text/plain tests/webtbs/tw3841.pp svneol=native#text/plain tests/webtbs/tw3863.pp svneol=native#text/plain diff --git a/compiler/nbas.pas b/compiler/nbas.pas index f2803b938e..c31b5324a9 100644 --- a/compiler/nbas.pas +++ b/compiler/nbas.pas @@ -176,7 +176,7 @@ interface ttempinfoflags = set of ttempinfoflag; const - tempinfostoreflags = [ti_may_be_in_reg,ti_addr_taken,ti_reference,ti_readonly,ti_no_final_regsync]; + tempinfostoreflags = [ti_may_be_in_reg,ti_addr_taken,ti_reference,ti_readonly,ti_no_final_regsync,ti_nofini,ti_const]; type { to allow access to the location by temp references even after the temp has } @@ -1101,10 +1101,23 @@ implementation procedure ttempcreatenode.printnodedata(var t:text); + var + f: ttempinfoflag; + first: Boolean; begin inherited printnodedata(t); writeln(t,printnodeindention,'size = ',size,', temptypedef = ',tempinfo^.typedef.typesymbolprettyname,' = "', tempinfo^.typedef.GetTypeName,'", tempinfo = $',hexstr(ptrint(tempinfo),sizeof(ptrint)*2)); + write(t,printnodeindention,'['); + first:=true; + for f in tempflags do + begin + if not(first) then + write(t,','); + write(t,f); + first:=false; + end; + writeln(t,']'); writeln(t,printnodeindention,'tempinit ='); printnode(t,tempinfo^.tempinitcode); end; diff --git a/tests/webtbs/tw38337.pp b/tests/webtbs/tw38337.pp new file mode 100644 index 0000000000..7d461ddfa9 --- /dev/null +++ b/tests/webtbs/tw38337.pp @@ -0,0 +1,20 @@ +program fs; + +{$mode objfpc}{$H+} + +function UTF8Length(const s: string): PtrInt; inline; +begin + Result:=9; +end; + + +var + v1: string; + s: shortstring; + i: Integer; +begin + v1 := '123456789'; + s := v1; + for i := 1 to UTF8Length(s)-8 do begin + end; +end.