|
|
Subscribe / Log in / New account

Partial static analysis of error paths

Partial static analysis of error paths

Posted Jan 5, 2015 10:06 UTC (Mon) by mtorni (guest, #3618)
Parent article: The "too small to fail" memory-allocation rule

Wouldn't static analysis of error-handling code help with checking some of those error paths?

I was thinking of checking all the execution paths (disregarding loops)
and producing a report of all possible cases of remaining allocations and not-rolled-back actions. For a simple function the report would be the "happy case" (several allocations in effect, perhaps a lock) and "failure" (no allocations and locks in effect after exit). If the function had error-handling bugs, there would be also be partial exit cases (some allocations in force, perhaps a lock).

Might be some work to implement, but the reports could be great for verification of code before commits.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds