-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone
Description
Type size calculations inside the compiler can overflow, resulting in memory unsafety. Types without a valid mem::size_of should be forbidden to prevent unsoundness. Types that are valid today would become invalid and this would interfere with an attempt to support integer type parameters. I think it's a serious backwards compatibility issue since the interaction with generics is very bad.
std::mem::size_of::<[[u8, ..!0u], ..!0u]>() returns 1, since !0u * !0u wraps to 1. The same thing can be done with other aggregate types like structs / tuples and an overflow could also occur from the tag added in an enum.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.