Fix bug in gen_cvt_ftoi1. Add test 107_stack_safe for this fix.
(Thanks to the support of herman ten brugge)
This commit is contained in:
parent
749dd15ee8
commit
a7b37f9c63
3 changed files with 16 additions and 0 deletions
2
tccgen.c
2
tccgen.c
|
|
@ -2627,7 +2627,9 @@ static void gen_cvt_ftoi1(int t)
|
||||||
gfunc_call(1);
|
gfunc_call(1);
|
||||||
vpushi(0);
|
vpushi(0);
|
||||||
vtop->r = REG_IRET;
|
vtop->r = REG_IRET;
|
||||||
|
#if PTR_SIZE == 4
|
||||||
vtop->r2 = REG_LRET;
|
vtop->r2 = REG_LRET;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
gen_cvt_ftoi(t);
|
gen_cvt_ftoi(t);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
tests/tests2/107_stack_safe.c
Normal file
13
tests/tests2/107_stack_safe.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
extern int printf(const char *, ...);
|
||||||
|
|
||||||
|
static void func_ull_ull(unsigned long long l1,unsigned long long l2){
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int a,b,c,d;
|
||||||
|
a=1;b=2;c=3;d=4;
|
||||||
|
func_ull_ull((unsigned long long)a/1.0,(unsigned long long)b/1.0);
|
||||||
|
printf("%d %d %d %d",a,b,c,d);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
1
tests/tests2/107_stack_safe.expect
Normal file
1
tests/tests2/107_stack_safe.expect
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
1 2 3 4
|
||||||
Loading…
Add table
Reference in a new issue