Skip to content

LLVM assertion with out-of-bounds indexing in a constant #23291

Closed
@reem

Description

@reem

Reproduce: http://is.gd/rk75YC

Inlined:

const FOO: [u32; 3] = [1, 2, 3];
const BAR: u32 = FOO[5];

fn main() { let _ = BAR; }

Error:

ustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/Constants.cpp:2189: static llvm::Constant* llvm::ConstantExpr::getExtractValue(llvm::Constant*, llvm::ArrayRef<unsigned int>, llvm::Type*): Assertion `ReqTy && "extractvalue indices invalid!"' failed.
Aborted (core dumped)
playpen: application terminated with error code 134

Metadata

Metadata

Assignees

Labels

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