mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Revert "Fix CFG construction of ExprStmt and StmtExpr"
This reverts commit db8d718cdbf0bef9cdf246221a921b99d4b22bea. It broke ql/java/ql/test/library-tests/successors/TestDeclarations
This commit is contained in:
@@ -909,8 +909,7 @@ private module ControlFlowGraphImpl {
|
||||
)
|
||||
or
|
||||
// the last node in an `ExprStmt` is the last node in the expression
|
||||
last(n.(ExprStmt).getExpr(), last, completion) and
|
||||
completion instanceof NormalOrBooleanCompletion
|
||||
last(n.(ExprStmt).getExpr(), last, completion) and completion = NormalCompletion()
|
||||
or
|
||||
// the last node in a `StmtExpr` is the last node in the statement
|
||||
last(n.(StmtExpr).getStmt(), last, completion)
|
||||
@@ -1233,9 +1232,9 @@ private module ControlFlowGraphImpl {
|
||||
n = synch and result = first(synch.getBlock())
|
||||
)
|
||||
or
|
||||
result = first(n.(ExprStmt).getExpr()) and completion instanceof NormalOrBooleanCompletion
|
||||
result = first(n.(ExprStmt).getExpr()) and completion = NormalCompletion()
|
||||
or
|
||||
result = first(n.(StmtExpr).getStmt()) and completion instanceof NormalOrBooleanCompletion
|
||||
result = first(n.(StmtExpr).getStmt()) and completion = NormalCompletion()
|
||||
or
|
||||
result = first(n.(LabeledStmt).getStmt()) and completion = NormalCompletion()
|
||||
or
|
||||
|
||||
@@ -41,6 +41,12 @@
|
||||
| Test.kt:100:25:110:1 | { ... } | Test.kt:105:20:107:5 | { ... } |
|
||||
| Test.kt:100:25:110:1 | { ... } | Test.kt:107:16:109:5 | ... -> ... |
|
||||
| Test.kt:100:25:110:1 | { ... } | Test.kt:107:27:109:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:100:1:110:1 | fn |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:101:33:103:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:105:5:109:5 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:105:20:107:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:107:16:109:5 | ... -> ... |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:107:27:109:5 | { ... } |
|
||||
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:105:20:107:5 | { ... } |
|
||||
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:107:16:109:5 | ... -> ... |
|
||||
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:107:27:109:5 | { ... } |
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
| Test.kt:95:4:97:2 | catch (...) | Test.kt:91:1:98:1 | t2 |
|
||||
| Test.kt:100:25:110:1 | { ... } | Test.kt:101:22:101:30 | ... -> ... |
|
||||
| Test.kt:100:25:110:1 | { ... } | Test.kt:101:22:101:30 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | ... -> ... | Test.kt:101:33:103:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | ... -> ... | Test.kt:105:5:109:5 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:101:33:103:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:105:5:109:5 | <Expr>; |
|
||||
| Test.kt:101:33:103:5 | { ... } | Test.kt:100:1:110:1 | fn |
|
||||
|
||||
@@ -188,8 +188,7 @@
|
||||
| Test.kt:101:22:101:30 | ... -> ... | WhenBranch | Test.kt:101:22:101:30 | true | BooleanLiteral |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | ExprStmt | Test.kt:101:22:101:22 | y | VarAccess |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | ExprStmt | Test.kt:101:22:101:30 | false | BooleanLiteral |
|
||||
| Test.kt:101:22:101:30 | false | BooleanLiteral | Test.kt:101:33:103:5 | { ... } | BlockStmt |
|
||||
| Test.kt:101:22:101:30 | false | BooleanLiteral | Test.kt:105:5:109:5 | <Expr>; | ExprStmt |
|
||||
| Test.kt:101:22:101:30 | false | BooleanLiteral | file://:0:0:0:0 | <none> | <none> |
|
||||
| Test.kt:101:22:101:30 | true | BooleanLiteral | Test.kt:101:22:101:30 | <Expr>; | ExprStmt |
|
||||
| Test.kt:101:27:101:30 | null | NullLiteral | Test.kt:101:22:101:30 | ... (value equals) ... | ValueEQExpr |
|
||||
| Test.kt:101:33:103:5 | { ... } | BlockStmt | Test.kt:102:15:102:25 | new Exception(...) | ClassInstanceExpr |
|
||||
|
||||
@@ -543,6 +543,15 @@
|
||||
| Test.kt:101:9:101:30 | ... -> ... | Test.kt:107:27:109:5 | { ... } |
|
||||
| Test.kt:101:9:101:30 | ... -> ... | Test.kt:108:9:108:29 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | ... -> ... | Test.kt:101:22:101:30 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:101:33:103:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:102:9:102:25 | throw ... |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:105:5:109:5 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:105:9:107:5 | ... -> ... |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:105:20:107:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:106:9:106:29 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:107:16:109:5 | ... -> ... |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:107:27:109:5 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:108:9:108:29 | <Expr>; |
|
||||
| Test.kt:101:33:103:5 | { ... } | Test.kt:102:9:102:25 | throw ... |
|
||||
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:105:9:107:5 | ... -> ... |
|
||||
| Test.kt:105:5:109:5 | <Expr>; | Test.kt:105:20:107:5 | { ... } |
|
||||
|
||||
@@ -210,6 +210,10 @@
|
||||
| Test.kt:101:9:101:30 | ... -> ... | Test.kt:100:25:110:1 | { ... } |
|
||||
| Test.kt:101:9:101:30 | ... -> ... | Test.kt:101:5:103:5 | ... -> ... |
|
||||
| Test.kt:101:9:101:30 | ... -> ... | Test.kt:101:5:103:5 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:100:25:110:1 | { ... } |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:101:5:103:5 | ... -> ... |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:101:5:103:5 | <Expr>; |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:101:9:101:30 | ... -> ... |
|
||||
| Test.kt:101:22:101:30 | <Expr>; | Test.kt:101:22:101:30 | ... -> ... |
|
||||
| Test.kt:102:9:102:25 | throw ... | Test.kt:101:33:103:5 | { ... } |
|
||||
| Test.kt:105:9:107:5 | ... -> ... | Test.kt:105:5:109:5 | <Expr>; |
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
| Test.kt:8:16:8:24 | ... (value not-equals) ... | This check is useless, $@ cannot be null here, since it is guarded by $@. | Test.kt:8:16:8:16 | y | y | Test.kt:2:22:2:30 | ... (value equals) ... | ... (value equals) ... |
|
||||
|
||||
Reference in New Issue
Block a user