Commit b4c2ff1
committed
Simplification of nested pointer arithmetic: do not assume same type
Pointer arithmetic is permitted with both signed and unsigned numeric
operands. Nested expressions could possibly mix this when the front-end
does not strictly use the same type for pointer arithmetic as for index
types. Observed in model-checking/kani#708.
Introducing type casts (as needed) exposed a further issue in this code:
it previously did not make sure that it was really the numeric operands
that ended up being grouped together. This became apparent on test
Pointer_Arithmetic15, which specifically constructs such expressions.1 parent 7214340 commit b4c2ff1
File tree
2 files changed
+10
-2
lines changed- regression/cbmc/Pointer_Arithmetic15
- src/util
2 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| 443 | + | |
| 444 | + | |
443 | 445 | | |
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
447 | 449 | | |
448 | | - | |
| 450 | + | |
| 451 | + | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
452 | 455 | | |
453 | | - | |
| 456 | + | |
| 457 | + | |
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
| |||
0 commit comments