mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Ruby: local dataflow step for || and &&
This commit is contained in:
@@ -89,3 +89,21 @@ def test_case x
|
||||
sink(z) # $ hasTaintFlow=1
|
||||
end
|
||||
|
||||
def and_or
|
||||
a = source(1) || source(2)
|
||||
sink(a) # $ hasValueFlow=1 hasValueFlow=2
|
||||
b = (source(1) or source(2))
|
||||
sink(b) # $ hasValueFlow=1 hasValueFlow=2
|
||||
|
||||
a = source(1) && source(2)
|
||||
sink(a) # $ hasValueFlow=1 hasValueFlow=2
|
||||
b = (source(1) and source(2))
|
||||
sink(b) # $ hasValueFlow=1 hasValueFlow=2
|
||||
|
||||
a = source(5)
|
||||
a ||= source(6)
|
||||
sink(a) # $ hasValueFlow=5 hasValueFlow=6
|
||||
b = source(7)
|
||||
b &&= source(8)
|
||||
sink(b) # $ hasValueFlow=7 hasValueFlow=8
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user