+ ensure the callee size paraloc info is available, when setting up a local var

or parameter in RAUtils.TOperand.SetupVar(). This fixes a compiler crash, when
  a parent parameter or local var is accessed (in certain ways) inside a nested
  inline asm routine.

git-svn-id: trunk@38236 -
This commit is contained in:
nickysn 2018-02-14 14:14:34 +00:00
parent 0baf3f69d8
commit b9e41330d4
3 changed files with 34 additions and 0 deletions

1
.gitattributes vendored
View File

@ -12510,6 +12510,7 @@ tests/test/tasm18e.pp svneol=native#text/plain
tests/test/tasm18f.pp svneol=native#text/plain
tests/test/tasm18g.pp svneol=native#text/plain
tests/test/tasm18h.pp svneol=native#text/plain
tests/test/tasm19.pp svneol=native#text/plain
tests/test/tasm2.inc svneol=native#text/plain
tests/test/tasm2.pp svneol=native#text/plain
tests/test/tasm2a.pp svneol=native#text/plain

View File

@ -816,6 +816,7 @@ var
(e.g. var tralala: word absolute moo[5]; ) }
absoffset: asizeint=0;
harrdef: tarraydef;
tmpprocinfo: tprocinfo;
Begin
SetupVar:=false;
asmsearchsym(s,sym,srsymtable);
@ -928,6 +929,17 @@ Begin
paravarsym,
localvarsym :
begin
tmpprocinfo:=current_procinfo;
while assigned(tmpprocinfo) do
begin
if (sym.owner=tmpprocinfo.procdef.localst) or
(sym.owner=tmpprocinfo.procdef.parast) then
begin
tmpprocinfo.procdef.init_paraloc_info(calleeside);
break;
end;
tmpprocinfo:=tmpprocinfo.parent;
end;
if opr.typ=OPR_REFERENCE then
begin
indexreg:=opr.ref.base;

21
tests/test/tasm19.pp Normal file
View File

@ -0,0 +1,21 @@
{ %NORUN }
{ %CPU=i8086 }
{$IFDEF FPC}
{$MODE TP}
{$ENDIF}
program tasm19;
procedure subpcrash(x: word);
procedure subtocrash; assembler;
asm
{ compiler crash here... }
mov ax,[si+offset x]
end;
begin
end;
begin
end.