-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
ICE on invalid size/alignment in CTFE validation #86193
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
The following code ICEs:
To fix this, this code here needs to properly catch the "invalid size/align" error and turn it into a validation failure:
rust/compiler/rustc_mir/src/interpret/validity.rs
Line 356 in 563ab4a
But for this we first need to make these errors catchable by introducing separate variants into this enum:
rust/compiler/rustc_middle/src/mir/interpret/error.rs
Line 211 in 2779fc1
You can use the existing
InvalidDropFnvariant as a model; it does the same job for invalid drop function pointers in the vtable.Cc @lqd