-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-craneliftThings relevant to the [future] cranelift backendThings relevant to the [future] cranelift backendC-bugCategory: This is a bug.Category: This is a bug.
Description
Running it in miri gives the following error:
error: Undefined Behavior: enum value has invalid tag: 0x07
--> example/union.rs:49:15
|
49 | match foo {
| ^^^ enum value has invalid tag: 0x07
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: inside `main` at example/union.rs:49:15
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
I found this issue because cg_clif aborts matching on an invalid discriminant.
cc @Smittyvb as you introduced this test.
Metadata
Metadata
Assignees
Labels
A-craneliftThings relevant to the [future] cranelift backendThings relevant to the [future] cranelift backendC-bugCategory: This is a bug.Category: This is a bug.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
syvb commentedon Mar 19, 2022
@rustbot claim
I forgot that the test actually got executed, I'll make a PR to move the UB parts to a
check-pass
test.Auto merge of rust-lang#95169 - Smittyvb:union-test-ub, r=bjorn3