Ruby: local dataflow step for || and &&

This commit is contained in:
Arthur Baars
2022-09-26 16:52:23 +02:00
parent e95b5468d9
commit 09bc78eafc
7 changed files with 236 additions and 4 deletions

View File

@@ -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