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
Checking logical statements involving constant-sized ranges gives up when it encounters overflow involving constants in programs (it returns Maybe). For example, for p + i, we need to scale i by the size of the referent type of p. That could overflow. We should return False and an error condition when that happens. The computation would fault at runtime (you can argue that a logical statement is false, because there is no program state for which it is true).
Also, we use signed integers that are the size of pointers to represent offsets. We will indicate overflow when a constant that is an unsigned integer is too large to be represented in these signed integer. The simple solution of using n+1 bits is not a good idea from a compiler performance perspective but it forces memory allocation for the common case. We should use n+1 bits only when necessary, but that means special-casing the code.
The text was updated successfully, but these errors were encountered:
Checking logical statements involving constant-sized ranges gives up when it encounters overflow involving constants in programs (it returns
Maybe
). For example, for p + i, we need to scale i by the size of the referent type of p. That could overflow. We should returnFalse
and an error condition when that happens. The computation would fault at runtime (you can argue that a logical statement is false, because there is no program state for which it is true).Also, we use signed integers that are the size of pointers to represent offsets. We will indicate overflow when a constant that is an unsigned integer is too large to be represented in these signed integer. The simple solution of using n+1 bits is not a good idea from a compiler performance perspective but it forces memory allocation for the common case. We should use n+1 bits only when necessary, but that means special-casing the code.
The text was updated successfully, but these errors were encountered: