Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d343d03
Align old CFG node strings with shared library
owen-mc Aug 11, 2026
355e006
Improve redundant recover test coverage
owen-mc Aug 12, 2026
a4a4fba
More tests for non-returning functions
owen-mc Aug 13, 2026
64e0af9
Test semantic invalid types in notype test
owen-mc Jul 13, 2026
921acc3
Make KeyValueExpr have the same type as its value
owen-mc Aug 13, 2026
cad0bef
Change mayReturnNormally to mustNotReturnNormally
owen-mc Aug 13, 2026
5413852
Distinguish panic and exit in logrus
owen-mc Aug 13, 2026
df5a0be
Model `logrus.Exit` like `os.Exit`
owen-mc Aug 13, 2026
423dd7a
Update two queries so alert locations don't change
owen-mc Jul 14, 2026
a0bb0ff
Make synthetic RangeElementExpr during extraction
owen-mc Aug 13, 2026
18af869
Switch to using shared CFG library
owen-mc Aug 13, 2026
9b01926
Add go/print-cfg
owen-mc May 13, 2026
705ac2a
Add Go CFG consistency query
owen-mc Jun 1, 2026
50337d3
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
1fd207c
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
f84d486
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
b16df3a
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
a066556
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
a8607dd
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
f7a566d
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
ed7cff5
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
0f46ee6
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
fdc4468
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
49ff0bd
No CFG nodes for subexprs of const exprs
owen-mc Jul 13, 2026
71b1ee8
Add change note
owen-mc Aug 13, 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