Changes between Version 92 and Version 93 of IR2
- Timestamp:
- 05/12/21 16:21:21 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR2
v92 v93 262 262 * An object of array type also becomes defined when assigned a `$new` value. In that case, the elements are also defined. 263 263 * A pointer becomes defined when assigned the result of an `$alloc`. Each element in the newly allocated object is undefined. 264 * Example: to determine whether it is safe to read `*(p+i)`, assert `$summable(p, i) && $valid(p+i) && $defined(*(p+i))`. You must check (1) you can sum `p` and `i`, (2) `p+i` points to an object of the base type, so dereference is safe, and (3) the object is defined (has been assigned a value). 264 * Example: to determine whether it is safe to read `*(p+i)`, assert `$summable(p, i) && $valid(p+i) && $defined(*(p+i))`. You must check (1) you can sum `p` and `i`, (2) `p+i` points to an object of the base type, so dereference is safe, and (3) the object is defined (has been assigned a value). If you aren't sure `p` and `i` have been defined, you can add `$defined(p) && $defined(i)` to the assertion. 265 265 266 266
