Skip to content

Commit 22835c2

Browse files
committed
Rust: Make a return node the last node before function exit
1 parent 1a000ec commit 22835c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ module Node {
190190

191191
/** A data flow node that represents a value returned by a callable. */
192192
final class ReturnNode extends ExprNode {
193-
ReturnNode() { this.asExpr() instanceof ReturnExpr }
193+
ReturnNode() { this.getCfgNode().getASuccessor() instanceof ExitCfgNode }
194194

195195
ReturnKind getKind() { any() }
196196
}

0 commit comments

Comments
 (0)