Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5766675
Align old CFG node strings with shared library
owen-mc Aug 11, 2026
5b7d8c9
Improve redundant recover test coverage
owen-mc Aug 12, 2026
f20834b
More tests for non-returning functions
owen-mc Aug 13, 2026
0838ebe
Test semantic invalid types in notype test
owen-mc Jul 13, 2026
bc05f5c
Make KeyValueExpr have the same type as its value
owen-mc Aug 13, 2026
4049f7f
Change mayReturnNormally to mustNotReturnNormally
owen-mc Aug 13, 2026
7ed380d
Distinguish panic and exit in logrus
owen-mc Aug 13, 2026
685be7d
Model `logrus.Exit` like `os.Exit`
owen-mc Aug 13, 2026
02c7716
Update two queries so alert locations don't change
owen-mc Jul 14, 2026
efe3a40
Make synthetic RangeElementExpr during extraction
owen-mc Aug 13, 2026
d6d0454
Switch to using shared CFG library
owen-mc Aug 13, 2026
59d7728
Add go/print-cfg
owen-mc May 13, 2026
2ab5c9a
Add Go CFG consistency query
owen-mc Jun 1, 2026
e6d353d
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
70de38a
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
848b2b9
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
0dd6ae6
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
8bb2e76
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
f255557
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
df33333
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
9bda102
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
dc5b927
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
bbf0cab
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
7466e50
No CFG nodes for subexprs of const exprs
owen-mc Jul 13, 2026
b4d7286
Add change note
owen-mc Aug 13, 2026
eba15bc
Replace IfStmt.getCond with IfStmt.getCondition
owen-mc Aug 18, 2026
753bc47
Address review comments
owen-mc Aug 18, 2026
6aaa08d
Add defer CFG edge-case tests
owen-mc Aug 19, 2026
d42dd20
Build defer edges from an early Go CFG
owen-mc Aug 19, 2026
2982ba7
Model Go function epilogues in the body CFG
owen-mc Aug 19, 2026
0a24980
Address more review comments
owen-mc Aug 19, 2026
a423b1e
Change CompoundAssignStmt and IncDecStmt
owen-mc Aug 19, 2026
6b15576
Move `getExpr` to `SwitchExpr`
owen-mc Aug 19, 2026
e4cf369
Remove/reduce comments
owen-mc Aug 19, 2026
08345e0
Rename file to ControlFlowGraphImpl.qll
owen-mc Aug 19, 2026
75bb943
Use american spelling
owen-mc Aug 19, 2026
2443727
Add missing qldoc
owen-mc Aug 19, 2026
5c16070
Update change note
owen-mc Aug 19, 2026
b01683c
Fix non-US spelling
owen-mc Sep 1, 2026
63c4b41
Change function epilogue CFG
owen-mc Sep 2, 2026
8dde10c
Remove CFG hook by making CFG for SelectStmt simpler
owen-mc Sep 2, 2026
3d5ed8b
Remove CFG hook preservesDefaultControlFlow
owen-mc Sep 2, 2026
85496f9
Allow empty switch to be a simple leaf node
owen-mc Sep 2, 2026
65fa122
Rename ForeachStmt to ForEachStmt
owen-mc Sep 2, 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