c3c
c3c copied to clipboard
Compiler assert with complex address in inline assembly.
module main;
fn int main()
{
int x;
asm
{
movl $eax, [&x + 1];
}
return 0;
}
⚠️ The compiler encountered an unexpected error: "TODO reached".
- Function: sema_check_asm_arg_addr(...)
- Source file: c3c/src/compiler/sema_asm.c:229
looks like this is a duplicate of #1927
So sorry! What about this?
module main;
fn int main()
{
int x;
asm
{
movl x, &x;
}
return 0;
}
⚠️ The compiler encountered an unexpected error: "TODO reached".
- Function: sema_check_asm_arg(...)
- Source file: c3c/src/compiler/sema_asm.c:542
That is different, but seems like it's under the same banner as the other issue. It could probably be added as a comment on the other issue or kept on this one, ig it's up to your/@lerno's judgment.
That latter is part of the size checking.