You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Initializing an array with [0, ..-1] compiles, but causes a segfault at runtime #6977
Ah, so this is really just crashing because it hits the bug we have on very large arrays. Perhaps this isn't really a separate issue than the integer literal overflow and large stack array ones?
Activity
Aatch commentedon Jun 6, 2013
Seems like a simple oversight, we should make sure that the length is >= 0. I am surprised it doesn't fail trying to emit a -1 alloca though.
luqmana commentedon Jun 6, 2013
Hmm yea, the count part is just casted to a uint so this is doing the equivalent of
[0, ..(MAX_UINT)]thestinger commentedon Jun 6, 2013
Ah, so this is really just crashing because it hits the bug we have on very large arrays. Perhaps this isn't really a separate issue than the integer literal overflow and large stack array ones?
Aatch commentedon Jun 6, 2013
@thestinger either way, negative-length arrays aren't a sane thing to write and should still fail as it's own thing.
auto merge of #6985 : Aatch/rust/fixed-vec-6977, r=thestinger
Auto merge of rust-lang#6977 - flip1995:or_patterns_msrv, r=llogiq
Merge rust-lang#6977