Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The compiler encountered an unexpected error #1927

@DanyDollaro

Description

@DanyDollaro

Trying to compile the following code:

fn int main(String[] args)
{
    char[12] buffer;

    asm
    {
        movl [&buffer + 0], $ebx;
    }

    return 0;
}

C3C generate the following output:

D:\Solutions\C3\test>c3c build
⚠️ The compiler encountered an unexpected error: "TODO reached".

- Function: sema_check_asm_arg_addr(...)
- Source file: D:\a\c3c\c3c\src\compiler\sema_asm.c:206

🙏 Please consider taking the time to file an issue on GitHub, so that we can get it fixed:

https://github.com/c3lang/c3c/issues/new so that we can get it fixed.

but it compiles fine when I remove the "+ 0":

fn int main(String[] args)
{
    char[12] buffer;

    asm
    {
        movl [&buffer], $ebx;
    }

    return 0;
}

I am on windows an I compiled with the latest release (0.6.6)

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions