Skip to content

LLVM abort: Ptr must be a pointer to Val type! #24589

@pnkfelix

Description

@pnkfelix

(imported from improperly closed bug #23679)

Code (playpen):

pub struct _X([u8]);

impl std::ops::Deref for _X {
    type Target = [u8];

    fn deref(&self) -> &[u8] {
        &self.0
    }
}

fn _f(_: &[u8]) { }

fn _g(x: &_X) { _f(x) }

fn main() { }

yields rustc crash (LLVM assert):

rustc: /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/llvm/lib/IR/Instructions.cpp:1083: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
Aborted (core dumped)
playpen: application terminated with error code 134

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions