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
7c4583d
Align old CFG node strings with shared library
owen-mc Aug 11, 2026
fbc5b2d
Improve redundant recover test coverage
owen-mc Aug 12, 2026
ffbb349
More tests for non-returning functions
owen-mc Aug 13, 2026
c5cb6fa
Test semantic invalid types in notype test
owen-mc Jul 13, 2026
bbbf3ec
Make KeyValueExpr have the same type as its value
owen-mc Aug 13, 2026
929051e
Change mayReturnNormally to mustNotReturnNormally
owen-mc Aug 13, 2026
e2c7da1
Distinguish panic and exit in logrus
owen-mc Aug 13, 2026
a9ed53d
Model `logrus.Exit` like `os.Exit`
owen-mc Aug 13, 2026
a562e90
Update two queries so alert locations don't change
owen-mc Jul 14, 2026
3ae2a87
Make synthetic RangeElementExpr during extraction
owen-mc Aug 13, 2026
f4f1eeb
Switch to using shared CFG library
owen-mc Aug 13, 2026
19d74bd
Add go/print-cfg
owen-mc May 13, 2026
2746132
Add Go CFG consistency query
owen-mc Jun 1, 2026
aadfda9
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
bee65c3
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
0ae85a0
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
91392ea
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
60c1a6a
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
246fc3e
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
5c987bc
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
0fdd166
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
a6d703a
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
6dfa1b4
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
1cc30d2
No CFG nodes for subexprs of const exprs
owen-mc Jul 13, 2026
d302fa7
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