mirror of
https://github.com/frida/tinycc
synced 2024-12-25 06:26:49 +03:00
Fix arm64-gen.c when passing a struct ptr to va_arg.
This commit is contained in:
parent
6fa78a3635
commit
ec0e93616f
@ -242,17 +242,22 @@ ST_FUNC void gsym_addr(int t_, int a_)
|
||||
|
||||
static int arm64_type_size(int t)
|
||||
{
|
||||
/*
|
||||
* case values are in increasing order (from 1 to 11).
|
||||
* which 'may' help compiler optimizers. See tcc.h
|
||||
*/
|
||||
switch (t & VT_BTYPE) {
|
||||
case VT_INT: return 2;
|
||||
case VT_BYTE: return 0;
|
||||
case VT_SHORT: return 1;
|
||||
case VT_INT: return 2;
|
||||
case VT_LLONG: return 3;
|
||||
case VT_PTR: return 3;
|
||||
case VT_FUNC: return 3;
|
||||
case VT_STRUCT: return 3;
|
||||
case VT_FLOAT: return 2;
|
||||
case VT_DOUBLE: return 3;
|
||||
case VT_LDOUBLE: return 4;
|
||||
case VT_BOOL: return 0;
|
||||
case VT_LLONG: return 3;
|
||||
}
|
||||
assert(0);
|
||||
return 0;
|
||||
|
@ -230,6 +230,17 @@ void ret(void)
|
||||
printf("%.1Lf %.1Lf\n", fr_hfa34().a, fr_hfa34().d);
|
||||
}
|
||||
|
||||
void*
|
||||
va_arg_with_struct_ptr(va_list ap) {
|
||||
/*
|
||||
* This was a BUG identified with FFTW-3.3.8 on arm64.
|
||||
* The test case only checks it compiles.
|
||||
*/
|
||||
struct X { int _x; };
|
||||
struct X *x = va_arg(ap, struct X *);
|
||||
return x;
|
||||
}
|
||||
|
||||
int match(const char **s, const char *f)
|
||||
{
|
||||
const char *p = *s;
|
||||
|
Loading…
Reference in New Issue
Block a user