Split memLeak paths with sem.malloc.fail - #2097
Conversation
This is necessary to pass 76-memleak/33-malloc-fail-no-mem-leak.
|
Could you explain why path-sensitivity is the right tool here? |
|
Sure, it wasn't my first idea either. Initially I thought I'd just replace the handling of analyzer/src/analyses/memLeak.ml Lines 207 to 217 in 3062271 In particular, to do the natural thing of joining states over all points-to targets. But the sound thing to do in the NullPtr case is to remove nothing, so that wouldn't help in such a case.
And matching 2-element points-to sets which contain such a removable pointer and The memLeak analysis is already path-sensitive w.r.t. its whole local state of allocated variables that still need to be freed, so this additional splitting seems to be the right way. Hopefully, the additional paths with |
sem.malloc.fail sem.malloc.fail
Closes #2093.
TODO