* fixed parsing of declarations before asm statement

This commit is contained in:
peter 2002-12-29 18:59:34 +00:00
parent 564e9701f7
commit 215ccaafe2
2 changed files with 29 additions and 29 deletions

View File

@ -1087,20 +1087,15 @@ implementation
{ space for the return value }
if not is_void(aktprocdef.rettype.def) then
begin
aktprocdef.funcretsym:=tfuncretsym.create(aktprocsym.name,aktprocdef.rettype);
{ insert in local symtable }
{ but with another name, so that recursive calls are possible }
symtablestack.insert(aktprocdef.funcretsym);
symtablestack.insertvardata(aktprocdef.funcretsym);
symtablestack.rename(aktprocdef.funcretsym.name,'$result');
{ update the symtablesize back to 0 if there were no locals }
if not haslocals then
symtablestack.datasize:=0;
symtablestack.rename(aktprocdef.funcretsym.name,'$result');
{ update the symtablesize back to 0 if there were no locals }
if not haslocals then
symtablestack.datasize:=0;
{ set the used registers depending on the function result }
procinfo.update_usedinproc_result;
{ set the used registers depending on the function result }
procinfo.update_usedinproc_result;
end;
end;
{ force the asm statement }
if token<>_ASM then
consume(_ASM);
@ -1147,7 +1142,10 @@ implementation
end.
{
$Log$
Revision 1.82 2002-12-27 18:18:56 peter
Revision 1.83 2002-12-29 18:59:34 peter
* fixed parsing of declarations before asm statement
Revision 1.82 2002/12/27 18:18:56 peter
* check for else after empty raise statement
Revision 1.81 2002/11/27 02:37:14 peter

View File

@ -84,21 +84,6 @@ implementation
var
storepos : tfileposinfo;
begin
{ parse const,types and vars }
read_declarations(islibrary);
{ do we have an assembler block without the po_assembler?
we should allow this for Delphi compatibility (PFV) }
if (token=_ASM) and (m_delphi in aktmodeswitches) then
include(aktprocdef.procoptions,po_assembler);
{ Handle assembler block different }
if (po_assembler in aktprocdef.procoptions) then
begin
block:=assembler_block;
exit;
end;
if not is_void(aktprocdef.rettype.def) then
begin
{ if the current is a function aktprocsym is non nil }
@ -119,9 +104,23 @@ implementation
symtablestack.insert(aktprocdef.resultfuncretsym);
end;
end;
{ parse const,types and vars }
read_declarations(islibrary);
procinfo.handle_body_start;
{ do we have an assembler block without the po_assembler?
we should allow this for Delphi compatibility (PFV) }
if (token=_ASM) and (m_delphi in aktmodeswitches) then
include(aktprocdef.procoptions,po_assembler);
{ Handle assembler block different }
if (po_assembler in aktprocdef.procoptions) then
begin
block:=assembler_block;
exit;
end;
{Unit initialization?.}
if (lexlevel=unit_init_level) and (current_module.is_unit)
or islibrary then
@ -819,7 +818,10 @@ implementation
end.
{
$Log$
Revision 1.84 2002-12-29 18:25:18 peter
Revision 1.85 2002-12-29 18:59:34 peter
* fixed parsing of declarations before asm statement
Revision 1.84 2002/12/29 18:25:18 peter
* parse declarations before check _ASM token
Revision 1.83 2002/12/29 14:57:50 peter