Performance fix - Use basic blocks instead of full cfg reachability.

This commit is contained in:
Joe Farebrother
2025-06-02 14:33:52 +01:00
parent acb9c20a76
commit 57a0c7a1ab
2 changed files with 37 additions and 18 deletions

View File

@@ -277,4 +277,11 @@ def closed28(path):
try:
f28.write("hi")
finally:
f28.close()
f28.close()
def closed29(path):
# Due to an approximation in CFG reachability for performance, it is not detected that the `write` call that may raise occurs after the file has already been closed.
# We presume this case to be uncommon.
f28 = open(path) # $SPURIOUS:notClosedOnException
f28.close()
f28.write("already closed")