ruby: also insert capturedExitRead-nodes by exceptional exits

This commit is contained in:
yoff
2025-05-13 15:11:00 +02:00
parent 73bae1627b
commit 774b1820c2
3 changed files with 1 additions and 3 deletions

View File

@@ -106,7 +106,6 @@ private predicate writesCapturedVariable(Cfg::BasicBlock bb, LocalVariable v) {
* at index `i` in exit block `bb`.
*/
private predicate capturedExitRead(Cfg::AnnotatedExitBasicBlock bb, int i, LocalVariable v) {
bb.isNormal() and
writesCapturedVariable(bb.getAPredecessor*(), v) and
i = bb.length()
}

View File

@@ -1,2 +1 @@
| DeadStoreOfLocal.rb:2:5:2:5 | y | This assignment to $@ is useless, since its value is never read. | DeadStoreOfLocal.rb:2:5:2:5 | y | y |
| DeadStoreOfLocal.rb:61:17:61:17 | x | This assignment to $@ is useless, since its value is never read. | DeadStoreOfLocal.rb:56:17:56:17 | x | x |

View File

@@ -58,7 +58,7 @@ def get_retried x
print x
if x < 1
begin
x += 1 #$ SPURIOUS: Alert
x += 1 #$ OK - the block may be executed again
raise StandardError
end
end