CPP: Remove successor edges from non-returning functions from the control flow graph.

This commit is contained in:
Geoffrey White
2018-10-22 10:37:38 +01:00
parent 44f5e26fb0
commit 6427e9658b
6 changed files with 91 additions and 74 deletions

View File

@@ -5,10 +5,6 @@
| test.cpp:48:2:48:26 | if (...) ... | Function g7 should return a value of type MyValue but does not return a value here |
| test.cpp:74:1:76:1 | { ... } | Function g10 should return a value of type second but does not return a value here |
| test.cpp:86:1:88:1 | { ... } | Function g12 should return a value of type second but does not return a value here |
| test.cpp:103:2:103:17 | ExprStmt | Function g13 should return a value of type int but does not return a value here |
| test.cpp:108:2:111:2 | if (...) ... | Function g14 should return a value of type int but does not return a value here |
| test.cpp:110:3:110:18 | ExprStmt | Function g14 should return a value of type int but does not return a value here |
| test.cpp:120:3:120:18 | ExprStmt | Function g15 should return a value of type int but does not return a value here |
| test.cpp:134:2:134:36 | ExprStmt | Function g16 should return a value of type int but does not return a value here |
| test.cpp:141:3:141:37 | ExprStmt | Function g17 should return a value of type int but does not return a value here |
| test.cpp:151:3:151:18 | ExprStmt | Function g18 should return a value of type int but does not return a value here |

View File

@@ -100,7 +100,7 @@ void myThrow(const char *error)
int g13()
{
myThrow("fail"); // GOOD [FALSE POSITIVE]
myThrow("fail"); // GOOD
}
int g14(int x)
@@ -117,7 +117,7 @@ int g15(int x)
{
return x;
} else {
myThrow("fail"); // GOOD [FALSE POSITIVE]
myThrow("fail"); // GOOD
}
}