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

LLVM assertion hit while building SpiderMonkey bindings #28502

Closed
michaelwu opened this issue Sep 18, 2015 · 6 comments
Closed

LLVM assertion hit while building SpiderMonkey bindings #28502

michaelwu opened this issue Sep 18, 2015 · 6 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@michaelwu
Copy link
Contributor

I have some code at https://gist.github.com/michaelwu/1040fa8f592ad020f893 . Building it with the latest nightly using rustc --crate-type lib jsapi.rs results in this assertion Assertion failed: (getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"), function AssertOK, file /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/llvm/lib/IR/Instructions.cpp, line 995..

I'm using rustc 1.5.0-nightly (cff0411 2015-09-17).

@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 19, 2015
@michaelwu
Copy link
Contributor Author

I've reduced the crash to: http://is.gd/wMIy8s

@michaelwu
Copy link
Contributor Author

I've reduced it even further. http://is.gd/IOPhRx

pub struct Handle {
    pub ptr: *const u32,
}

pub struct ObjectOpResult;
impl ObjectOpResult {
    pub extern "C" fn test(_obj: Handle) {
    }
}

@dotdash
Copy link
Contributor

dotdash commented Sep 21, 2015

Looks like we're not generating a shim to bridge between the C ABI and the Rust ABI when the function appears in an impl block.

@liebharc
Copy link

liebharc commented Dec 6, 2015

I've found this issue report since I just hit the same issue in my pet project. One thing which might be relevant is that the example http://is.gd/IOPhRx compiles fine on my Windows machine and fails on my Linux machine. Both machines are running:

rustc 1.6.0-nightly (338cdd7e0 2015-11-24)

@mrhota
Copy link
Contributor

mrhota commented Mar 1, 2017

@steveklabnik @michaelwu's testcase doesn't crash on stable or nightly.

@michaelwu
Copy link
Contributor Author

Guess it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants