mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:06:14 +02:00
* fixed parsing of declarations before asm statement
This commit is contained in:
parent
564e9701f7
commit
215ccaafe2
@ -1087,20 +1087,15 @@ implementation
|
|||||||
{ space for the return value }
|
{ space for the return value }
|
||||||
if not is_void(aktprocdef.rettype.def) then
|
if not is_void(aktprocdef.rettype.def) then
|
||||||
begin
|
begin
|
||||||
aktprocdef.funcretsym:=tfuncretsym.create(aktprocsym.name,aktprocdef.rettype);
|
symtablestack.rename(aktprocdef.funcretsym.name,'$result');
|
||||||
{ insert in local symtable }
|
{ update the symtablesize back to 0 if there were no locals }
|
||||||
{ but with another name, so that recursive calls are possible }
|
if not haslocals then
|
||||||
symtablestack.insert(aktprocdef.funcretsym);
|
symtablestack.datasize:=0;
|
||||||
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;
|
|
||||||
|
|
||||||
{ set the used registers depending on the function result }
|
{ set the used registers depending on the function result }
|
||||||
procinfo.update_usedinproc_result;
|
procinfo.update_usedinproc_result;
|
||||||
|
end;
|
||||||
|
|
||||||
end;
|
|
||||||
{ force the asm statement }
|
{ force the asm statement }
|
||||||
if token<>_ASM then
|
if token<>_ASM then
|
||||||
consume(_ASM);
|
consume(_ASM);
|
||||||
@ -1147,7 +1142,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* check for else after empty raise statement
|
||||||
|
|
||||||
Revision 1.81 2002/11/27 02:37:14 peter
|
Revision 1.81 2002/11/27 02:37:14 peter
|
||||||
|
@ -84,21 +84,6 @@ implementation
|
|||||||
var
|
var
|
||||||
storepos : tfileposinfo;
|
storepos : tfileposinfo;
|
||||||
begin
|
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
|
if not is_void(aktprocdef.rettype.def) then
|
||||||
begin
|
begin
|
||||||
{ if the current is a function aktprocsym is non nil }
|
{ if the current is a function aktprocsym is non nil }
|
||||||
@ -119,9 +104,23 @@ implementation
|
|||||||
symtablestack.insert(aktprocdef.resultfuncretsym);
|
symtablestack.insert(aktprocdef.resultfuncretsym);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{ parse const,types and vars }
|
||||||
|
read_declarations(islibrary);
|
||||||
|
|
||||||
procinfo.handle_body_start;
|
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?.}
|
{Unit initialization?.}
|
||||||
if (lexlevel=unit_init_level) and (current_module.is_unit)
|
if (lexlevel=unit_init_level) and (current_module.is_unit)
|
||||||
or islibrary then
|
or islibrary then
|
||||||
@ -819,7 +818,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* parse declarations before check _ASM token
|
||||||
|
|
||||||
Revision 1.83 2002/12/29 14:57:50 peter
|
Revision 1.83 2002/12/29 14:57:50 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user