File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,8 +28,6 @@ predicate inVoidContext(Expr e) {
2828 i < n - 1 or inVoidContext ( seq )
2929 )
3030 or
31- exists ( ParExpr par | par .getExpression ( ) = e and inVoidContext ( par ) )
32- or
3331 exists ( ForStmt stmt | e = stmt .getUpdate ( ) )
3432 or
3533 exists ( ForStmt stmt | e = stmt .getInit ( ) |
@@ -38,8 +36,4 @@ predicate inVoidContext(Expr e) {
3836 )
3937 or
4038 exists ( LogicalBinaryExpr logical | e = logical .getRightOperand ( ) and inVoidContext ( logical ) )
41- or
42- exists ( TypeAssertion assert | assert .getExpression ( ) = e and inVoidContext ( assert ) )
43- or
44- exists ( UnaryExpr unOp | unOp .getOperator ( ) = "void" and unOp .getOperand ( ) = e )
4539}
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ predicate benignContext(Expr e) {
4242 exists ( SeqExpr parent | parent .getAnOperand ( ) = e and benignContext ( parent ) )
4343 or
4444 exists ( ParExpr par | par .getExpression ( ) = e and benignContext ( par ) )
45+ or
46+ exists ( TypeAssertion assert | assert .getExpression ( ) = e and inVoidContext ( assert ) )
47+ or
48+ exists ( UnaryExpr unOp | unOp .getOperator ( ) = "void" and unOp .getOperand ( ) = e )
4549 or
4650
4751 // It is ok (or to be flagged by another query?) to await a non-async function.
You can’t perform that action at this time.
0 commit comments