Skip to content

Commit 9859c59

Browse files
committed
Ruby: Reintroduce lack of BeginExpr nodes.
1 parent b92748f commit 9859c59

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

ruby/ql/lib/codeql/ruby/controlflow/CfgNodes.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,13 @@ module ExprNodes {
424424

425425
/** A control-flow node that wraps a `StmtSequence` AST expression. */
426426
class StmtSequenceCfgNode extends ExprCfgNode {
427+
// TODO: This charpred represents a bug and should be removed when the
428+
// resulting additional data flow does not break performance.
429+
// The old CFG did not include `BeginExpr` nodes in the CFG, but the
430+
// current CFG does. This charpred thus keeps a small subset of the old
431+
// behavior in order to avoid regressions.
432+
StmtSequenceCfgNode() { not super.getExpr() instanceof BeginExpr }
433+
427434
override string getAPrimaryQlClass() { result = "StmtSequenceCfgNode" }
428435

429436
override StmtSequence e;

0 commit comments

Comments
 (0)