Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when compiling function missing return with inline assembly #4543

Open
zyedidia opened this issue Dec 11, 2023 · 0 comments
Open

Crash when compiling function missing return with inline assembly #4543

zyedidia opened this issue Dec 11, 2023 · 0 comments

Comments

@zyedidia
Copy link
Contributor

This function fails to return a value even though it has return type ulong, but since there is an inline assembly block, instead of emitting an error the compiler crashes:

ulong foo() {
    asm {
        "nop";
    }
}
$ ldc2 test.d
Function return type does not match operand type of return inst!
  ret void
 i64LLVM ERROR: Broken function found, compilation aborted!
#0 0x000055fa024ee053 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/zyedidia/ldc2-1.32.0/bin/ldc2+0x5fd6053)
Aborted (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant