Skip to content

LLVM abort on address of dereference of byte string literal #19748

Closed
@sp3d

Description

@sp3d

Compiling the program:

fn main() { &*b"foo"; }

gives the output:

rustc: /build/rust-git/src/rust/src/llvm/lib/IR/Constants.cpp:1992: static llvm::Constant* llvm::ConstantExpr::getGetElementPtr(llvm::Constant*, llvm::ArrayRef<llvm::Value*>, bool, llvm::Type*): Assertion `C->getType()->isPtrOrPtrVectorTy() && "Non-pointer type for constant GetElementPtr expression"' failed.

Issue #17233 seems as if it might be related, but it's not the same assertion failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions