C++: Data flow through StmtExpr

This commit is contained in:
Jonas Jensen
2019-01-10 15:39:56 +01:00
parent a2de057c26
commit 0a57767cc6
4 changed files with 10 additions and 2 deletions

View File

@@ -495,7 +495,7 @@ void intArraySourceCaller2() {
///////////////////////////////////////////////////////////////////////////////
void throughStmtExpr(int source1, int clean1) {
sink( ({ source1; }) ); // tainted (FALSE NEGATIVE)
sink( ({ source1; }) ); // tainted
sink( ({ clean1; }) ); // clean
int local = ({
@@ -506,5 +506,5 @@ void throughStmtExpr(int source1, int clean1) {
tmp = clean1;
tmp;
});
sink(local); // tainted (FALSE NEGATIVE)
sink(local); // tainted
}

View File

@@ -35,6 +35,8 @@
| test.cpp:478:8:478:12 | local | test.cpp:477:20:477:24 | ref arg local |
| test.cpp:485:8:485:12 | local | test.cpp:484:18:484:23 | ref arg & ... |
| test.cpp:491:8:491:12 | local | test.cpp:490:18:490:22 | ref arg local |
| test.cpp:498:9:498:22 | (statement expression) | test.cpp:497:26:497:32 | source1 |
| test.cpp:509:8:509:12 | local | test.cpp:497:26:497:32 | source1 |
| true_upon_entry.cpp:21:8:21:8 | x | true_upon_entry.cpp:17:11:17:16 | call to source |
| true_upon_entry.cpp:29:8:29:8 | x | true_upon_entry.cpp:27:9:27:14 | call to source |
| true_upon_entry.cpp:39:8:39:8 | x | true_upon_entry.cpp:33:11:33:16 | call to source |

View File

@@ -17,6 +17,8 @@
| test.cpp:477:20:477:24 | test.cpp:478:8:478:12 | AST only |
| test.cpp:484:18:484:23 | test.cpp:485:8:485:12 | AST only |
| test.cpp:490:18:490:22 | test.cpp:491:8:491:12 | AST only |
| test.cpp:497:26:497:32 | test.cpp:498:9:498:22 | AST only |
| test.cpp:497:26:497:32 | test.cpp:509:8:509:12 | AST only |
| true_upon_entry.cpp:9:11:9:16 | true_upon_entry.cpp:13:8:13:8 | IR only |
| true_upon_entry.cpp:62:11:62:16 | true_upon_entry.cpp:66:8:66:8 | IR only |
| true_upon_entry.cpp:98:11:98:16 | true_upon_entry.cpp:105:8:105:8 | IR only |