Ruby: Add another variable capture test

This commit is contained in:
Tom Hvitved
2024-02-22 09:39:01 +01:00
parent 8bbfb82f8e
commit 007d08ea63
2 changed files with 15 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
testFailures
| captured_variables.rb:227:13:227:31 | # $ hasValueFlow=18 | Missing result:hasValueFlow=18 |
edges
| blocks.rb:14:12:14:20 | call to source | blocks.rb:8:10:8:14 | yield ... | provenance | |
| captured_variables.rb:9:24:9:24 | x | captured_variables.rb:10:10:10:23 | -> { ... } [captured x] | provenance | |

View File

@@ -214,3 +214,17 @@ class CaptureOverwrite
fn.call()
end
def multi_capture
x = taint(18)
y = 123
fn1 = -> {
y = x
}
fn1.call()
sink(y) # $ hasValueFlow=18
end
multi_capture