mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
ruby: also insert capturedExitRead-nodes by exceptional exits
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user