Commit d4e61f8
committed
Byte-extract lowering: do not blindly use offsets
When unpacking an array we must not create 0 bytes up until an offset
when the source array can never be as large. Doing so when within a
struct would spuriously produce a larger member.
The test case highlighted a problem in the SMT2 back-end: the first
operand of a struct was not correctly flattened and instead used default
expression conversion (which is only ok when the array theory is never
being used). To avoid this problem creeping in again, factor out the
operand conversion into a lambda and invoke that lambda each time.
Fixes: #76541 parent 5cd2d1b commit d4e61f8
File tree
5 files changed
+86
-47
lines changed- regression/cbmc/byte_extract2
- src
- solvers/smt2
- util
5 files changed
+86
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3280 | 3280 | | |
3281 | 3281 | | |
3282 | 3282 | | |
3283 | | - | |
3284 | | - | |
3285 | | - | |
| 3283 | + | |
3286 | 3284 | | |
3287 | 3285 | | |
3288 | 3286 | | |
3289 | 3287 | | |
3290 | 3288 | | |
3291 | 3289 | | |
3292 | 3290 | | |
3293 | | - | |
3294 | | - | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
3295 | 3296 | | |
3296 | | - | |
3297 | | - | |
3298 | | - | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
3299 | 3300 | | |
3300 | | - | |
3301 | | - | |
3302 | | - | |
3303 | | - | |
3304 | | - | |
3305 | | - | |
3306 | | - | |
3307 | | - | |
3308 | | - | |
3309 | | - | |
3310 | | - | |
3311 | | - | |
3312 | | - | |
3313 | | - | |
3314 | | - | |
3315 | | - | |
3316 | | - | |
3317 | | - | |
3318 | | - | |
| 3301 | + | |
| 3302 | + | |
3319 | 3303 | | |
3320 | 3304 | | |
3321 | | - | |
3322 | | - | |
| 3305 | + | |
3323 | 3306 | | |
3324 | | - | |
| 3307 | + | |
3325 | 3308 | | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
3326 | 3314 | | |
3327 | 3315 | | |
3328 | 3316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1207 | 1207 | | |
1208 | 1208 | | |
1209 | 1209 | | |
1210 | | - | |
| 1210 | + | |
1211 | 1211 | | |
1212 | 1212 | | |
1213 | 1213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
526 | | - | |
527 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| |||
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
579 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
580 | 583 | | |
581 | 584 | | |
582 | 585 | | |
| |||
777 | 780 | | |
778 | 781 | | |
779 | 782 | | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
788 | 804 | | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
793 | 810 | | |
794 | 811 | | |
795 | 812 | | |
796 | 813 | | |
797 | 814 | | |
| 815 | + | |
798 | 816 | | |
799 | 817 | | |
800 | 818 | | |
| |||
0 commit comments