mirror of
https://github.com/cc65/cc65.git
synced 2024-07-22 12:29:06 +00:00
Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1269 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
6ff2aeb8df
commit
badef3c8e5
@ -215,6 +215,7 @@ void NewFunc (SymEntry* Func)
|
|||||||
{
|
{
|
||||||
int HadReturn;
|
int HadReturn;
|
||||||
int IsVoidFunc;
|
int IsVoidFunc;
|
||||||
|
SymEntry* LastParam;
|
||||||
|
|
||||||
/* Get the function descriptor from the function entry */
|
/* Get the function descriptor from the function entry */
|
||||||
FuncDesc* D = Func->V.F.Func;
|
FuncDesc* D = Func->V.F.Func;
|
||||||
@ -225,6 +226,9 @@ void NewFunc (SymEntry* Func)
|
|||||||
/* Reenter the lexical level */
|
/* Reenter the lexical level */
|
||||||
ReenterFunctionLevel (D);
|
ReenterFunctionLevel (D);
|
||||||
|
|
||||||
|
/* Before adding more symbols, remember the last parameter for later */
|
||||||
|
LastParam = D->SymTab->SymTail;
|
||||||
|
|
||||||
/* Declare two special functions symbols: __fixargs__ and __argsize__.
|
/* Declare two special functions symbols: __fixargs__ and __argsize__.
|
||||||
* The latter is different depending on the type of the function (variadic
|
* The latter is different depending on the type of the function (variadic
|
||||||
* or not).
|
* or not).
|
||||||
@ -251,15 +255,11 @@ void NewFunc (SymEntry* Func)
|
|||||||
/* If this is a fastcall function, push the last parameter onto the stack */
|
/* If this is a fastcall function, push the last parameter onto the stack */
|
||||||
if (IsFastCallFunc (Func->Type) && D->ParamCount > 0) {
|
if (IsFastCallFunc (Func->Type) && D->ParamCount > 0) {
|
||||||
|
|
||||||
SymEntry* LastParam;
|
|
||||||
unsigned Flags;
|
unsigned Flags;
|
||||||
|
|
||||||
/* Fastcall functions may never have an ellipsis or the compiler is buggy */
|
/* Fastcall functions may never have an ellipsis or the compiler is buggy */
|
||||||
CHECK ((D->Flags & FD_VARIADIC) == 0);
|
CHECK ((D->Flags & FD_VARIADIC) == 0);
|
||||||
|
|
||||||
/* Get a pointer to the last parameter entry */
|
|
||||||
LastParam = D->SymTab->SymTail;
|
|
||||||
|
|
||||||
/* Generate the push */
|
/* Generate the push */
|
||||||
if (IsTypeFunc (LastParam->Type)) {
|
if (IsTypeFunc (LastParam->Type)) {
|
||||||
/* Pointer to function */
|
/* Pointer to function */
|
||||||
|
Loading…
Reference in New Issue
Block a user