JS: support push and sort taint steps for arrays

This commit is contained in:
Esben Sparre Andreasen
2018-08-30 09:14:06 +02:00
parent 61bd003cf9
commit 86ab9adb06
3 changed files with 27 additions and 0 deletions

View File

@@ -1,2 +1,5 @@
| tst.js:2:13:2:20 | source() | tst.js:4:10:4:10 | x |
| tst.js:2:13:2:20 | source() | tst.js:5:10:5:22 | "/" + x + "!" |
| tst.js:2:13:2:20 | source() | tst.js:14:10:14:17 | x.sort() |
| tst.js:2:13:2:20 | source() | tst.js:17:10:17:10 | a |
| tst.js:2:13:2:20 | source() | tst.js:19:10:19:10 | a |

View File

@@ -10,4 +10,12 @@ function test() {
sink(x === 1); // OK
sink(undefined == x); // OK
sink(x === x); // OK
sink(x.sort()); // NOT OK
var a = [];
sink(a); // NOT OK (flow-insensitive treatment of `a`)
a.push(x);
sink(a); // NOT OK
}