Casting a struct to Object crash in the C compiler instead of catching it before
This simple code will pass the Valac compiler and will crash with an error message cannot convert to a pointer type
:
struct AAA {
int aaa;
}
void test(Object obj) {
}
int main() {
AAA a = { 1 };
test((Object) a);
return 0;
}
I tried looking where it happens, at GTypeModule.visit_cast_expression
it tries to cast it but I'm not sure if it should be stopped before or not. Would be glad to get some directions what would be the expected behavior.