Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f2c8576
Align old CFG node strings with shared library
owen-mc Aug 11, 2026
590d6dc
Improve redundant recover test coverage
owen-mc Aug 12, 2026
04e2bbf
More tests for non-returning functions
owen-mc Aug 13, 2026
9c2cea6
Test semantic invalid types in notype test
owen-mc Jul 13, 2026
1b92cc6
Make KeyValueExpr have the same type as its value
owen-mc Aug 13, 2026
695c114
Change mayReturnNormally to mustNotReturnNormally
owen-mc Aug 13, 2026
8c2929a
Distinguish panic and exit in logrus
owen-mc Aug 13, 2026
88ea517
Model `logrus.Exit` like `os.Exit`
owen-mc Aug 13, 2026
4392dcd
Update two queries so alert locations don't change
owen-mc Jul 14, 2026
2eadde4
Make synthetic RangeElementExpr during extraction
owen-mc Aug 13, 2026
61df021
Switch to using shared CFG library
owen-mc Aug 13, 2026
f5118e1
Add go/print-cfg
owen-mc May 13, 2026
fa06332
Add Go CFG consistency query
owen-mc Jun 1, 2026
84c59c4
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
a1caf0f
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
fa0428f
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
e7a1f89
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
48cd0c2
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
e736f1b
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
17d10ce
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
c6107fd
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
fed5b7d
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
76da30e
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
9020ea3
No CFG nodes for subexprs of const exprs
owen-mc Jul 13, 2026
db47577
Add change note
owen-mc Aug 13, 2026
e426dcb
Replace IfStmt.getCond with IfStmt.getCondition
owen-mc Aug 18, 2026
4025b04
Address review comments
owen-mc Aug 18, 2026
0a6055f
Add defer CFG edge-case tests
owen-mc Aug 19, 2026
4afa992
Build defer edges from an early Go CFG
owen-mc Aug 19, 2026
0b817f3
Model Go function epilogues in the body CFG
owen-mc Aug 19, 2026
562669a
Address more review comments
owen-mc Aug 19, 2026
de20d07
Change CompoundAssignStmt and IncDecStmt
owen-mc Aug 19, 2026
c80dd0e
Move `getExpr` to `SwitchExpr`
owen-mc Aug 19, 2026
1a8d240
Remove/reduce comments
owen-mc Aug 19, 2026
ce8352c
Rename file to ControlFlowGraphImpl.qll
owen-mc Aug 19, 2026
18ecee9
Use american spelling
owen-mc Aug 19, 2026
0a930ee
Add missing qldoc
owen-mc Aug 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions go/downgrades/d0e7336b491e35a4c890e0b9755a4030d32ee444/exprs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class Expr_ extends @expr {
string toString() { result = "Expr" }
}

class ExprParent_ extends @exprparent {
string toString() { result = "ExprParent" }
}

// The schema for exprs is:
//
// exprs(unique int id: @expr,
// int kind: int ref,
// int parent: @exprparent ref,
// int idx: int ref);
//
// `@rangeelementexpr` (kind 55) is a synthesized node that groups the loop
// variables (the key and value) of a `range` statement. To downgrade we remove
// those nodes and reparent their children (the key and value expressions)
// directly onto the `range` statement, at the same indices.
from Expr_ id, int kind, ExprParent_ newparent, int idx
where
exists(ExprParent_ parent | exprs(id, kind, parent, idx) and kind != 55 |
// A key or value grouped by a range element node: reparent it onto the
// range statement (the range element node's own parent).
exists(Expr_ pe | pe = parent and exprs(pe, 55, newparent, _))
or
// Any other expression keeps its parent unchanged.
not exists(Expr_ pe | pe = parent and exprs(pe, 55, _, _)) and
newparent = parent
)
select id, kind, newparent, idx
Loading
Loading