Skip to content

Conversation

adienes
Copy link
Member

@adienes adienes commented Sep 8, 2025

master:

julia> big_index = isqrt(typemax(Int))
3037000499

julia> LI = LinearIndices((big_index, big_index, 2));

julia> LI[end, end, 2]
-11857053614

PR:

julia> big_index = isqrt(typemax(Int))
3037000499

julia> LI = LinearIndices((big_index, big_index, 2));
ERROR: OverflowError: 9223372030926249001 * 2 overflowed for type Int64
Stacktrace:

I suppose there is a more general discussion in #50486 about which operations should be careful around internal overflows, but this seems like one of them. I did try to add @boundscheck and @propagate_inbounds to make this skippable, but I couldn't get it to work right

@adienes adienes added the arrays [a, r, r, a, y, s] label Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant