Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,47 +141,3 @@ nodes
| test.cpp:1697:2:1697:22 | ... += ... | semmle.label | ... += ... |
| test.cpp:1773:2:1773:22 | ... += ... | semmle.label | ... += ... |
subpaths
testFailures
| test.cpp:422:2:422:14 | ... += ... | Unexpected result: Alert |
| test.cpp:440:2:440:11 | ... ++ | Unexpected result: Alert |
| test.cpp:456:2:456:12 | ... ++ | Unexpected result: Alert |
| test.cpp:681:2:681:23 | ... += ... | Unexpected result: Alert |
| test.cpp:813:2:813:40 | ... = ... | Unexpected result: Alert |
| test.cpp:813:21:813:40 | ... + ... | Unexpected result: Alert |
| test.cpp:818:2:818:24 | ... = ... | Unexpected result: Alert |
| test.cpp:818:13:818:24 | ... + ... | Unexpected result: Alert |
| test.cpp:951:3:951:25 | ... = ... | Unexpected result: Alert |
| test.cpp:951:14:951:25 | ... + ... | Unexpected result: Alert |
| test.cpp:969:3:969:12 | ... ++ | Unexpected result: Alert |
| test.cpp:1051:2:1051:11 | ... ++ | Unexpected result: Alert |
| test.cpp:1071:16:1071:23 | increment_arg output argument | Unexpected result: Alert |
| test.cpp:1075:27:1075:35 | increment_arg_by_pointer output argument | Unexpected result: Alert |
| test.cpp:1129:2:1129:26 | ... = ... | Unexpected result: Alert |
| test.cpp:1129:14:1129:26 | ... - ... | Unexpected result: Alert |
| test.cpp:1180:2:1180:19 | ... = ... | Unexpected result: Alert |
| test.cpp:1219:2:1219:28 | ... = ... | Unexpected result: Alert |
| test.cpp:1219:16:1219:28 | ... + ... | Unexpected result: Alert |
| test.cpp:1234:2:1234:28 | ... = ... | Unexpected result: Alert |
| test.cpp:1234:16:1234:28 | ... + ... | Unexpected result: Alert |
| test.cpp:1248:2:1248:28 | ... = ... | Unexpected result: Alert |
| test.cpp:1248:16:1248:28 | ... + ... | Unexpected result: Alert |
| test.cpp:1262:2:1262:26 | ... = ... | Unexpected result: Alert |
| test.cpp:1262:14:1262:26 | ... + ... | Unexpected result: Alert |
| test.cpp:1276:2:1276:26 | ... = ... | Unexpected result: Alert |
| test.cpp:1276:14:1276:26 | ... + ... | Unexpected result: Alert |
| test.cpp:1282:2:1282:28 | ... = ... | Unexpected result: Alert |
| test.cpp:1282:16:1282:28 | ... + ... | Unexpected result: Alert |
| test.cpp:1294:2:1294:28 | ... = ... | Unexpected result: Alert |
| test.cpp:1294:16:1294:28 | ... + ... | Unexpected result: Alert |
| test.cpp:1307:2:1307:26 | ... = ... | Unexpected result: Alert |
| test.cpp:1307:14:1307:26 | ... + ... | Unexpected result: Alert |
| test.cpp:1319:2:1319:26 | ... = ... | Unexpected result: Alert |
| test.cpp:1319:14:1319:26 | ... + ... | Unexpected result: Alert |
| test.cpp:1361:2:1361:17 | ... = ... | Unexpected result: Alert |
| test.cpp:1535:2:1535:15 | ... = ... | Unexpected result: Alert |
| test.cpp:1565:2:1565:22 | ... += ... | Unexpected result: Alert |
| test.cpp:1573:2:1573:22 | ... += ... | Unexpected result: Alert |
| test.cpp:1652:2:1652:22 | ... += ... | Unexpected result: Alert |
| test.cpp:1664:2:1664:22 | ... += ... | Unexpected result: Alert |
| test.cpp:1697:2:1697:22 | ... += ... | Unexpected result: Alert |
| test.cpp:1773:2:1773:22 | ... += ... | Unexpected result: Alert |

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ private class ExternalCommandLineArgumentSource extends CommandLineArgumentSourc
* A data flow source that represents the parameters of the `Main` method of a program.
*/
private class MainMethodArgumentSource extends CommandLineArgumentSource {
MainMethodArgumentSource() { this.asParameter().getFunction() instanceof TopLevelFunction }
MainMethodArgumentSource() {
this.asParameter().getFunction() instanceof TopLevelFunction and
not this.asParameter() instanceof PipelineParameter and
not this.asParameter() instanceof PipelineByPropertyNameParameter
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
| test.ps1:1:1:43:0 | [synth] pipeline | Unexpected result: type="command line argument" |
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
| test.py:4:17:4:60 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) |
| test.py:4:33:4:59 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) |
| test_dict.py:4:17:4:60 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) |
| test_dict.py:4:33:4:59 | ControlFlowNode for Attribute() | Unexpected result: unresolved_call=os.path.dirname(..) |
2 changes: 1 addition & 1 deletion python/ql/test/library-tests/dataflow/fieldflow/test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import os

sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..)
sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..) unresolved_call=os.path.dirname(..) unresolved_call=os.path.dirname(..)
from testlib import expects

# These are defined so that we can evaluate the test code.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import os

sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..)
sys.path.append(os.path.dirname(os.path.dirname((__file__)))) # $ unresolved_call=sys.path.append(..) unresolved_call=os.path.dirname(..) unresolved_call=os.path.dirname(..)
from testlib import expects

# These are defined so that we can evaluate the test code.
Expand Down
36 changes: 36 additions & 0 deletions ruby/ql/test/library-tests/dataflow/array-flow/array-flow.expected
Original file line number Diff line number Diff line change
Expand Up @@ -4877,6 +4877,42 @@ subpaths
| array_flow.rb:1678:9:1678:9 | a : Array [element 2] | array_flow.rb:1678:19:1678:19 | x | array_flow.rb:1679:9:1679:9 | x | array_flow.rb:1678:9:1680:7 | call to map : [collection] [element] |
| array_flow.rb:1704:17:1704:27 | call to source | array_flow.rb:1693:10:1693:14 | *args : Array [element 1] | array_flow.rb:1694:5:1694:21 | call to [] : Array [element 1] | array_flow.rb:1704:9:1704:31 | call to m141 : Array [element 1] |
testFailures
| array_flow.rb:107:15:107:35 | # $ hasValueFlow=11.2 | Missing result: hasValueFlow=11.2 |
| array_flow.rb:226:16:226:34 | # $ hasValueFlow=25 | Missing result: hasValueFlow=25 |
| array_flow.rb:319:15:319:35 | # $ hasValueFlow=36.1 | Missing result: hasValueFlow=36.1 |
| array_flow.rb:320:15:320:35 | # $ hasValueFlow=36.1 | Missing result: hasValueFlow=36.1 |
| array_flow.rb:321:15:321:35 | # $ hasValueFlow=36.1 | Missing result: hasValueFlow=36.1 |
| array_flow.rb:328:15:328:55 | # $ hasValueFlow=37.1 $ hasValueFlow=37.2 | Missing result: hasValueFlow=37.1 |
| array_flow.rb:486:16:486:56 | # $ hasValueFlow=54.2 $ hasValueFlow=54.3 | Missing result: hasValueFlow=54.2 |
| array_flow.rb:490:16:490:76 | # $ hasValueFlow=54.2 $ hasValueFlow=54.3 $ hasValueFlow=54.4 | Missing result: hasValueFlow=54.2 |
| array_flow.rb:490:16:490:76 | # $ hasValueFlow=54.2 $ hasValueFlow=54.3 $ hasValueFlow=54.4 | Missing result: hasValueFlow=54.3 |
| array_flow.rb:494:16:494:96 | # $ hasValueFlow=54.2 $ hasValueFlow=54.3 $ hasValueFlow=54.4 $ hasValueFlow=54.5 | Missing result: hasValueFlow=54.2 |
| array_flow.rb:494:16:494:96 | # $ hasValueFlow=54.2 $ hasValueFlow=54.3 $ hasValueFlow=54.4 $ hasValueFlow=54.5 | Missing result: hasValueFlow=54.3 |
| array_flow.rb:659:15:659:55 | # $ hasValueFlow=70.1 $ hasValueFlow=70.3 | Missing result: hasValueFlow=70.1 |
| array_flow.rb:664:15:664:55 | # $ hasValueFlow=70.1 $ hasValueFlow=70.3 | Missing result: hasValueFlow=70.1 |
| array_flow.rb:928:16:928:56 | # $ hasValueFlow=90.1 $ hasValueFlow=90.2 | Missing result: hasValueFlow=90.1 |
| array_flow.rb:1099:15:1099:78 | # $ hasValueFlow=105.1 $ hasValueFlow=105.2 $ hasValueFlow=105.3 | Missing result: hasValueFlow=105.2 |
| array_flow.rb:1100:15:1100:57 | # $ hasValueFlow=105.1 $ hasValueFlow=105.3 | Missing result: hasValueFlow=105.3 |
| array_flow.rb:1110:15:1110:57 | # $ hasValueFlow=105.1 $ hasValueFlow=105.2 | Missing result: hasValueFlow=105.2 |
| array_flow.rb:1111:15:1111:57 | # $ hasValueFlow=105.1 $ hasValueFlow=105.3 | Missing result: hasValueFlow=105.3 |
| array_flow.rb:1162:15:1162:36 | # $ hasValueFlow=108.1 | Missing result: hasValueFlow=108.1 |
| array_flow.rb:1164:15:1164:36 | # $ hasValueFlow=108.2 | Missing result: hasValueFlow=108.2 |
| array_flow.rb:1170:15:1170:57 | # $ hasValueFlow=108.1 $ hasValueFlow=108.2 | Missing result: hasValueFlow=108.1 |
| array_flow.rb:1172:15:1172:36 | # $ hasValueFlow=108.2 | Missing result: hasValueFlow=108.2 |
| array_flow.rb:1224:15:1224:57 | # $ hasValueFlow=111.1 $ hasValueFlow=111.2 | Missing result: hasValueFlow=111.1 |
| array_flow.rb:1233:15:1233:36 | # $ hasValueFlow=111.1 | Missing result: hasValueFlow=111.1 |
| array_flow.rb:1238:15:1238:36 | # $ hasValueFlow=111.1 | Missing result: hasValueFlow=111.1 |
| array_flow.rb:1265:15:1265:36 | # $ hasValueFlow=112.1 | Missing result: hasValueFlow=112.1 |
| array_flow.rb:1286:15:1286:36 | # $ hasValueFlow=112.1 | Missing result: hasValueFlow=112.1 |
| array_flow.rb:1288:15:1288:36 | # $ hasValueFlow=112.2 | Missing result: hasValueFlow=112.2 |
| array_flow.rb:1297:15:1297:57 | # $ hasValueFlow=112.1 $ hasValueFlow=112.2 | Missing result: hasValueFlow=112.1 |
| array_flow.rb:1299:15:1299:36 | # $ hasValueFlow=112.2 | Missing result: hasValueFlow=112.2 |
| array_flow.rb:1308:15:1308:57 | # $ hasValueFlow=112.1 $ hasValueFlow=112.2 | Missing result: hasValueFlow=112.1 |
| array_flow.rb:1310:15:1310:36 | # $ hasValueFlow=112.2 | Missing result: hasValueFlow=112.2 |
| array_flow.rb:1346:15:1346:36 | # $ hasValueFlow=112.1 | Missing result: hasValueFlow=112.1 |
| array_flow.rb:1457:16:1457:37 | # $ hasValueFlow=121.2 | Missing result: hasValueFlow=121.2 |
| array_flow.rb:1458:16:1458:58 | # $ hasValueFlow=121.1 $ hasValueFlow=121.2 | Missing result: hasValueFlow=121.2 |
| array_flow.rb:1565:16:1565:58 | # $ hasValueFlow=132.1 $ hasValueFlow=132.2 | Missing result: hasValueFlow=132.1 |
arrayLiteral
| array_flow.rb:9:9:9:25 | call to [] |
| array_flow.rb:33:9:33:22 | call to [] |
Expand Down
68 changes: 34 additions & 34 deletions ruby/ql/test/library-tests/dataflow/array-flow/array_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def m11(i)
b = a[0...2] # exclusive range
sink b[0]
sink b[1] # $ hasValueFlow=11.1
sink b[2]
sink b[2] # $ hasValueFlow=11.2

a = [0, source(11.1), 1, source(11.2)]
b = a[1 .. -2] # we can't model negative ranges precisely
Expand Down Expand Up @@ -223,7 +223,7 @@ def m24
def m25
a = [0, 1, source(25)]
b = a.clear()
sink(a[2])
sink(a[2]) # $ hasValueFlow=25
sink(b[2])
end

Expand Down Expand Up @@ -316,16 +316,16 @@ def m36
a = [0, 1, source(36.1)]
b = a.delete(2) { source(36.2) }
sink b # $ hasValueFlow=36.1 $ hasValueFlow=36.2
sink a[0]
sink a[1]
sink a[2]
sink a[0] # $ hasValueFlow=36.1
sink a[1] # $ hasValueFlow=36.1
sink a[2] # $ hasValueFlow=36.1
end

def m37(i)
a = [0, 1, source(37.1), source(37.2)]
b = a.delete_at(2)
sink b # $ hasValueFlow=37.1
sink a[2] # $ hasValueFlow=37.2
sink a[2] # $ hasValueFlow=37.1 $ hasValueFlow=37.2

a = [0, 1, source(37.1), source(37.2)]
b = a.delete_at(i)
Expand Down Expand Up @@ -483,15 +483,15 @@ def m54
a.fill(source(54.2), 1, 1)
sink(a[3]) # $ hasValueFlow=54.1 $ hasValueFlow=54.2
a.fill(source(54.3))
sink(a[0]) # $ hasValueFlow=54.3
sink(a[0]) # $ hasValueFlow=54.2 $ hasValueFlow=54.3
a.fill do |i|
source(54.4)
end
sink(a[0]) # $ hasValueFlow=54.4
sink(a[0]) # $ hasValueFlow=54.2 $ hasValueFlow=54.3 $ hasValueFlow=54.4
a.fill(2) do |i|
source(54.5)
end
sink(a[0]) # $ hasValueFlow=54.4 $ hasValueFlow=54.5
sink(a[0]) # $ hasValueFlow=54.2 $ hasValueFlow=54.3 $ hasValueFlow=54.4 $ hasValueFlow=54.5
end

def m55
Expand Down Expand Up @@ -656,12 +656,12 @@ def m70(i)
b = a.insert(1, source(70.2), source(70.3))
sink a[0] # 0
sink a[1] # $ hasValueFlow=70.2
sink a[2] # $ hasValueFlow=70.3
sink a[2] # $ hasValueFlow=70.1 $ hasValueFlow=70.3
sink a[3] # 1
sink a[4] # $ hasValueFlow=70.1
sink b[0] # 0
sink b[1] # $ hasValueFlow=70.2
sink b[2] # $ hasValueFlow=70.3
sink b[2] # $ hasValueFlow=70.1 $ hasValueFlow=70.3
sink b[3] # 1
sink b[4] # $ hasValueFlow=70.1

Expand Down Expand Up @@ -925,7 +925,7 @@ def m90
a.prepend(2, 3, source(90.2))
sink(a[0])
sink(a[1])
sink(a[2]) # $ hasValueFlow=90.2
sink(a[2]) # $ hasValueFlow=90.1 $ hasValueFlow=90.2
sink(a[3])
sink(a[4])
sink(a[5]) # $ hasValueFlow=90.1
Expand Down Expand Up @@ -1096,8 +1096,8 @@ def m105(i)
b = a.rotate!
sink a[0] # $ hasValueFlow=105.1
sink a[1] # $ hasValueFlow=105.1 $ hasValueFlow=105.2
sink a[2] # $ hasValueFlow=105.1 $ hasValueFlow=105.3
sink a[3] # $ hasValueFlow=105.1
sink a[2] # $ hasValueFlow=105.1 $ hasValueFlow=105.2 $ hasValueFlow=105.3
sink a[3] # $ hasValueFlow=105.1 $ hasValueFlow=105.3
sink b[0] # $ hasValueFlow=105.1
sink b[1] # $ hasValueFlow=105.1 $ hasValueFlow=105.2
sink b[2] # $ hasValueFlow=105.1 $ hasValueFlow=105.3
Expand All @@ -1107,8 +1107,8 @@ def m105(i)
b = a.rotate!(2)
sink a[0] # $ hasValueFlow=105.1 $ hasValueFlow=105.2
sink a[1] # $ hasValueFlow=105.1 $ hasValueFlow=105.3
sink a[2] # $ hasValueFlow=105.1
sink a[3] # $ hasValueFlow=105.1
sink a[2] # $ hasValueFlow=105.1 $ hasValueFlow=105.2
sink a[3] # $ hasValueFlow=105.1 $ hasValueFlow=105.3
sink b[0] # $ hasValueFlow=105.1 $ hasValueFlow=105.2
sink b[1] # $ hasValueFlow=105.1 $ hasValueFlow=105.3
sink b[2] # $ hasValueFlow=105.1
Expand Down Expand Up @@ -1159,17 +1159,17 @@ def m108(i)
a = [source(108.1), 1, source(108.2)]
b = a.shift
sink b # $ hasValueFlow=108.1
sink a[0]
sink a[0] # $ hasValueFlow=108.1
sink a[1] # $ hasValueFlow=108.2
sink a[2]
sink a[2] # $ hasValueFlow=108.2

a = [source(108.1), 1, source(108.2)]
b = a.shift(2)
sink b[0] # $ hasValueFlow=108.1
sink b[1]
sink a[0] # $ hasValueFlow=108.2
sink a[0] # $ hasValueFlow=108.1 $ hasValueFlow=108.2
sink a[1]
sink a[2]
sink a[2] # $ hasValueFlow=108.2

a = [source(108.1), 1, source(108.2)]
b = a.shift(i)
Expand Down Expand Up @@ -1221,7 +1221,7 @@ def m111(i)
b = a.slice(2, 3)
sink b[0] # $ hasValueFlow=111.1
sink b[1]
sink b[2] # $ hasValueFlow=111.2
sink b[2] # $ hasValueFlow=111.1 $ hasValueFlow=111.2

b = a.slice(1, i) # unknown range
sink b[0] # $ hasValueFlow=111.1 $ hasValueFlow=111.2
Expand All @@ -1230,12 +1230,12 @@ def m111(i)
b = a.slice(2..3) # inclusive range
sink b[0] # $ hasValueFlow=111.1
sink b[1]
sink b[2]
sink b[2] # $ hasValueFlow=111.1

b = a.slice(2...4) # exclusive range
sink b[0] # $ hasValueFlow=111.1
sink b[1]
sink b[2]
sink b[2] # $ hasValueFlow=111.1

b = a.slice(3..i) # unknown range
sink b[0] # $ hasValueFlow=111.1 $ hasValueFlow=111.2
Expand All @@ -1262,7 +1262,7 @@ def m112(i)
sink b # $ hasValueFlow=112.1
sink a[0]
sink a[1]
sink a[2]
sink a[2] # $ hasValueFlow=112.1
sink a[3] # $ hasValueFlow=112.2

a = [0, 1, source(112.1), 2, source(112.2)]
Expand All @@ -1283,9 +1283,9 @@ def m112(i)
sink b[2] # $ hasValueFlow=112.2
sink a[0]
sink a[1]
sink a[2]
sink a[2] # $ hasValueFlow=112.1
sink a[3]
sink a[4]
sink a[4] # $ hasValueFlow=112.2

a = [0, 1, source(112.1), 2, source(112.2)]
b = a.slice!(2..3) # inclusive range
Expand All @@ -1294,9 +1294,9 @@ def m112(i)
sink b[2]
sink a[0]
sink a[1]
sink a[2] # $ hasValueFlow=112.2
sink a[2] # $ hasValueFlow=112.1 $ hasValueFlow=112.2
sink a[3]
sink a[4]
sink a[4] # $ hasValueFlow=112.2

a = [0, 1, source(112.1), 2, source(112.2)]
b = a.slice!(2...4) # exclusive range
Expand All @@ -1305,9 +1305,9 @@ def m112(i)
sink b[2]
sink a[0]
sink a[1]
sink a[2] # $ hasValueFlow=112.2
sink a[2] # $ hasValueFlow=112.1 $ hasValueFlow=112.2
sink a[3]
sink a[4]
sink a[4] # $ hasValueFlow=112.2

a = [0, 1, source(112.1), 2, source(112.2)]
b = a.slice!(2, i) # unknown range
Expand Down Expand Up @@ -1343,7 +1343,7 @@ def m112(i)
sink b[2] # $ hasValueFlow=112.1
sink a[0]
sink a[1] # $ hasValueFlow=112.2
sink a[2]
sink a[2] # $ hasValueFlow=112.1

a = [0, 1, source(112.1), 2, source(112.2)]
b = a.slice!(3..) # unknown range
Expand Down Expand Up @@ -1454,8 +1454,8 @@ def m121(i)
sink(b[0])
sink(b[1])
sink(b[2]) # $ hasValueFlow=121.1
sink(b[3])
sink(b[i]) # $ hasValueFlow=121.1
sink(b[3]) # $ hasValueFlow=121.2
sink(b[i]) # $ hasValueFlow=121.1 $ hasValueFlow=121.2
b = a.take(133)
sink(b[0])
sink(b[1])
Expand Down Expand Up @@ -1562,7 +1562,7 @@ def m132
a.unshift(2, 3, source(132.2))
sink(a[0])
sink(a[1])
sink(a[2]) # $ hasValueFlow=132.2
sink(a[2]) # $ hasValueFlow=132.1 $ hasValueFlow=132.2
sink(a[3])
sink(a[4])
sink(a[5]) # $ hasValueFlow=132.1
Expand Down
Loading
Loading