-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: assertion failure in LLVM when returning a struct from "extern" function. #21454
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
Comments
#17257 tracks a number of cases that throw the same error. |
A couple of hints - it looks like it happens when structure size is actually smaller or equal to register of architecture. I had the similar report for failing on iOS with the following sample:
It fails on |
sigh I actually saw that when I was working on #20755 but didn't come up with a test case that would trigger a problem here and then forgot about it. Will look into this. |
@dotdash will fix hit the upcoming beta? |
Sorry, fixing a few regressions in LLVM that affected rust had higher priority for me than this issue (because LLVM is very close to its 3.6 release), so I couldn't devote much time to this issue yet. But given that the beta is still ~3 weeks away, I'm positive that I'll get around to have it fixed by then. |
Hmm, beta is on week of Feb 16 (i.e. next week), isn't it? |
@vhbit Yes. http://blog.rust-lang.org/2014/12/12/1.0-Timeline.html Although, as someone hitting that bug, I'd be okay if that were flagged as a known bug and would prefer if semantic issues were cared about first. |
As the function comment already says, the types generated in the foreign_signture function don't necessarily match the types used for a corresponding rust function. Therefore we can't just use these types to guide the translation of the wrapper function that bridges between the external ABI and the rust ABI. Instead, we can query LLVM about the types used in the rust function and use those to generate an appropriate wrapper. Fixes rust-lang#21454
As the function comment already says, the types generated in the foreign_signture function don't necessarily match the types used for a corresponding rust function. Therefore we can't just use these types to guide the translation of the wrapper function that bridges between the external ABI and the rust ABI. Instead, we can query LLVM about the types used in the rust function and use those to generate an appropriate wrapper. Fixes #21454
@dotdash 🎉 thanks a lot! |
Repro:
ICE:
The text was updated successfully, but these errors were encountered: