forked from Mirrors/tinycc
Set VT_LVAL_xxx flags for function arguments in gfunc_prolog (Daniel Glöckner)
parent
8f7e3f325d
commit
2c657f6608
|
@ -956,7 +956,7 @@ void gfunc_prolog(CType *func_type)
|
||||||
#ifdef TCC_ARM_EABI
|
#ifdef TCC_ARM_EABI
|
||||||
addr = (addr + align - 1) & -align;
|
addr = (addr + align - 1) & -align;
|
||||||
#endif
|
#endif
|
||||||
sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | VT_LVAL, addr);
|
sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | lvalue_type(type->t), addr);
|
||||||
addr += size;
|
addr += size;
|
||||||
}
|
}
|
||||||
last_itod_magic=0;
|
last_itod_magic=0;
|
||||||
|
|
|
@ -1964,7 +1964,7 @@ void gfunc_prolog(CType * func_type)
|
||||||
/* define parameters */
|
/* define parameters */
|
||||||
while ((sym = sym->next) != NULL) {
|
while ((sym = sym->next) != NULL) {
|
||||||
type = &sym->type;
|
type = &sym->type;
|
||||||
sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | VT_LVAL, addr);
|
sym_push(sym->v & ~SYM_FIELD, type, VT_LOCAL | lvalue_type(type->t), addr);
|
||||||
size = type_size(type, &align);
|
size = type_size(type, &align);
|
||||||
size = (size + 3) & ~3;
|
size = (size + 3) & ~3;
|
||||||
|
|
||||||
|
|
|
@ -471,7 +471,7 @@ void gfunc_prolog(CType *func_type)
|
||||||
addr += size;
|
addr += size;
|
||||||
}
|
}
|
||||||
sym_push(sym->v & ~SYM_FIELD, type,
|
sym_push(sym->v & ~SYM_FIELD, type,
|
||||||
VT_LOCAL | VT_LVAL, param_addr);
|
VT_LOCAL | lvalue_type(type->t), param_addr);
|
||||||
param_index++;
|
param_index++;
|
||||||
}
|
}
|
||||||
func_ret_sub = 0;
|
func_ret_sub = 0;
|
||||||
|
|
2
il-gen.c
2
il-gen.c
|
@ -449,7 +449,7 @@ void gfunc_prolog(int t)
|
||||||
while ((sym = sym->next) != NULL) {
|
while ((sym = sym->next) != NULL) {
|
||||||
u = sym->t;
|
u = sym->t;
|
||||||
sym_push(sym->v & ~SYM_FIELD, u,
|
sym_push(sym->v & ~SYM_FIELD, u,
|
||||||
VT_LOCAL | VT_LVAL, addr);
|
VT_LOCAL | lvalue_type(sym->type.t), addr);
|
||||||
addr++;
|
addr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue