mirror of
https://github.com/github/codeql.git
synced 2026-04-22 23:35:14 +02:00
Ruby: Add another variable capture test
This commit is contained in:
@@ -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 | |
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user