Commit 790f0d5
committed
malloc: fix getting malloc size
After the rebase to new CBMC, constant propagation does not work in some
cases. This is a problem for our malloc handling as we require to see:
malloc_size = sizeof(...)
This commit fixes the problem by recursively searching for the malloc
size expression to handle cases like:
size = sizeof(...)
malloc_size = size
Also adds a regression test for this case.1 parent 41669a8 commit 790f0d5
File tree
3 files changed
+50
-8
lines changed- regression/memsafety/double_free
- src/ssa
3 files changed
+50
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
292 | 324 | | |
293 | 325 | | |
294 | 326 | | |
| |||
336 | 368 | | |
337 | 369 | | |
338 | 370 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 371 | + | |
| 372 | + | |
347 | 373 | | |
348 | 374 | | |
349 | 375 | | |
| |||
0 commit comments