-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
LLVM could theoretically detect that this array iteration bound is invalid, and generate illegal loads here, since the information passed to unsafe_wrap is not valid (the max possible legal size here is also typemax(Int)/sizeof(Int), though that still would trigger UB)
NgSpice.jl/src/API/get_vector.jl
Line 54 in b56aece
| function listallplots(nplots=Int(maxintfloat())) |
maxintfloat is even more of an issue here because (a) Float is not involved anywhere (b) On 32-bit, that would correspond to exactly typemax, but that is not larger than the representable maximum value that is legal.
It is not particularly clear why it would decide to try to vectorize this code, since unsafe_string is already expensive there, but formally this array size could trigger UB since it aliases other memory and points to memory that is undefined.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels