mirror of
https://github.com/frida/tinycc
synced 2024-12-25 14:36:49 +03:00
tccgen: gen_assign_cast(): cannot cast struct to scalar
The case below previously was causing an assertion failure in the target specific generator. It probably is not incorrect not to allow this even if gcc does. struct S { long b; }; void f(struct S *x) { struct S y[1] = { *x }; }
This commit is contained in:
parent
9e0e05eb4e
commit
1ca685f887
3
tccgen.c
3
tccgen.c
@ -2523,10 +2523,13 @@ static void gen_assign_cast(CType *dt)
|
|||||||
case VT_LLONG:
|
case VT_LLONG:
|
||||||
if (sbt == VT_PTR || sbt == VT_FUNC) {
|
if (sbt == VT_PTR || sbt == VT_FUNC) {
|
||||||
tcc_warning("assignment makes integer from pointer without a cast");
|
tcc_warning("assignment makes integer from pointer without a cast");
|
||||||
|
} else if (sbt == VT_STRUCT) {
|
||||||
|
goto case_VT_STRUCT;
|
||||||
}
|
}
|
||||||
/* XXX: more tests */
|
/* XXX: more tests */
|
||||||
break;
|
break;
|
||||||
case VT_STRUCT:
|
case VT_STRUCT:
|
||||||
|
case_VT_STRUCT:
|
||||||
tmp_type1 = *dt;
|
tmp_type1 = *dt;
|
||||||
tmp_type2 = *st;
|
tmp_type2 = *st;
|
||||||
tmp_type1.t &= ~(VT_CONSTANT | VT_VOLATILE);
|
tmp_type1.t &= ~(VT_CONSTANT | VT_VOLATILE);
|
||||||
|
Loading…
Reference in New Issue
Block a user