Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a0dc0d2
Align old CFG node strings with shared library
owen-mc Aug 11, 2026
2daa7ed
Improve redundant recover test coverage
owen-mc Aug 12, 2026
b82db67
More tests for non-returning functions
owen-mc Aug 13, 2026
62f2b42
Test semantic invalid types in notype test
owen-mc Jul 13, 2026
9c749eb
Make KeyValueExpr have the same type as its value
owen-mc Aug 13, 2026
2200bfa
Change mayReturnNormally to mustNotReturnNormally
owen-mc Aug 13, 2026
af19ef3
Distinguish panic and exit in logrus
owen-mc Aug 13, 2026
304ec85
Model `logrus.Exit` like `os.Exit`
owen-mc Aug 13, 2026
a772b42
Update two queries so alert locations don't change
owen-mc Jul 14, 2026
171046a
Make synthetic RangeElementExpr during extraction
owen-mc Aug 13, 2026
1f64f10
Switch to using shared CFG library
owen-mc Aug 13, 2026
30a0488
Add go/print-cfg
owen-mc May 13, 2026
e7000ab
Add Go CFG consistency query
owen-mc Jun 1, 2026
0bd998f
fold implicit-one operand into incdec-rhs instruction
owen-mc Jul 10, 2026
dee1d8c
fold compound-assign write into the compound-rhs instruction
owen-mc Jul 10, 2026
2c77287
drop implicit slice-bound nodes
owen-mc Jul 10, 2026
16b2eaa
Merge 'result-init' node into 'result-zero-init'
owen-mc Jul 10, 2026
16b9560
Fold implicit literal element index into the lit-init node
owen-mc Jul 10, 2026
5383fe8
Fold uninitialised var-decl zero-init and write into one node
owen-mc Jul 10, 2026
857f549
Fold tuple-destructuring extract and write into one node
owen-mc Jul 10, 2026
00815e9
Unify result-zero-init and zero-init node kinds
owen-mc Jul 10, 2026
cf6bf47
Simplify zero-init code after unifying result-zero-init
owen-mc Jul 10, 2026
8f90962
Unify incdec-rhs into the compound-rhs node kind
owen-mc Jul 10, 2026
59c5534
No CFG nodes for subexprs of const exprs
owen-mc Jul 13, 2026
9b523f2
Add change note
owen-mc Aug 13, 2026
6df8595
Replace IfStmt.getCond with IfStmt.getCondition
owen-mc Aug 18, 2026
864e10a
Address review comments
owen-mc Aug 18, 2026
b66ccd8
Add defer CFG edge-case tests
owen-mc Aug 19, 2026
b815f92
Build defer edges from an early Go CFG
owen-mc Aug 19, 2026
290fa45
Model Go function epilogues in the body CFG
owen-mc Aug 19, 2026
85fb77e
Address more review comments
owen-mc Aug 19, 2026
f344944
Change CompoundAssignStmt and IncDecStmt
owen-mc Aug 19, 2026
6e48157
Move `getExpr` to `SwitchExpr`
owen-mc Aug 19, 2026
f37db60
Remove/reduce comments
owen-mc Aug 19, 2026
7e48a1e
Rename file to ControlFlowGraphImpl.qll
owen-mc Aug 19, 2026
cfe78ef
Use american spelling
owen-mc Aug 19, 2026
c2d6703
Add missing qldoc
owen-mc Aug 19, 2026
c9276a0
Update change note
owen-mc Aug 19, 2026
b0427e0
Fix non-US spelling
owen-mc Sep 1, 2026
187e3fd
Change function epilogue CFG
owen-mc Sep 2, 2026
65cffd7
Remove CFG hook by making CFG for SelectStmt simpler
owen-mc Sep 2, 2026
b93595e
Remove CFG hook preservesDefaultControlFlow
owen-mc Sep 2, 2026
563fae2
Allow empty switch to be a simple leaf node
owen-mc Sep 2, 2026
d3298c7
Rename ForeachStmt to ForEachStmt
owen-mc Sep 2, 2026
0593055
Undo unnecessary code changes
owen-mc Sep 3, 2026
ff260f5
Skip extracting ast.ParenExpr nodes
owen-mc Jul 9, 2026
82c2fd1
Deprecate ParenExpr and remove all references
owen-mc Jul 9, 2026
17033d8
Accept `invalidAbruptCompletionOrigin` results
owen-mc Sep 4, 2026
f76a0e4
Fix `invalidAbruptCompletionOrigin` results
owen-mc Sep 4, 2026
2c36cb9
Restore data flow through pointer assignment targets
owen-mc Sep 4, 2026
c236b40
Fix go/whitespace-contradicts-precendence for ParenExpr removal
owen-mc Sep 8, 2026
3d9f2f3
Fix bad join order
owen-mc Sep 8, 2026
79724e7
(Performance) don't materialize ancestor relation
owen-mc Sep 10, 2026
2dd2c2d
(Performance) speed up GVN calculations by using contracted graph
owen-mc Sep 10, 2026
eaf952d
Shared CFG: Add `includeCallableEntry` hook
owen-mc Sep 10, 2026
948c032
Performance: Use `includeCallableEntry` hook
owen-mc Sep 10, 2026
f49ab92
Minor refactor (don't use AstNode.getNumChild)
owen-mc Sep 10, 2026
c5bd6ab
Refactor: avoid transitive closures
owen-mc Sep 10, 2026
c875d32
Limit Go build-constraint regex matching to initial comments
owen-mc Sep 10, 2026
1728570
Fix bad join order
owen-mc Sep 11, 2026
e6bbfb2
Cache Go CFG root lookup
owen-mc Sep 11, 2026
aea3d94
Use shared CFG leaf representation more for Go
owen-mc Sep 11, 2026
00b3005
Use shared default sequencing for ordinary Go operations
owen-mc Sep 11, 2026
efc650b
Use shared CFG leaf nodes for Go function literals
owen-mc Sep 11, 2026
54329d6
Add QLDoc to `skipCfg`
owen-mc Sep 11, 2026
48479b1
Cache Go IR write-target construction
owen-mc Sep 11, 2026
02a6899
Limit Go explicit CFG child ranking to its consumers
owen-mc Sep 11, 2026
861446c
Remove unnecessary `Instruction.getRoot` overrides
owen-mc Sep 15, 2026
69ed945
Cache `getEnclosingCallable`
owen-mc Sep 15, 2026
85f0fb5
Single node for function, import, type decls
owen-mc Sep 15, 2026
6727aba
Add missing QLDoc in shared library
owen-mc Sep 15, 2026
1ea39dd
Fix bad join order in `getANonTestPassingReachingNodeRecursive`
owen-mc Sep 16, 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
2 changes: 0 additions & 2 deletions go/docs/language/learn-ql/go/ast-class-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,6 @@ Miscellaneous
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``...`` | `Ellipsis <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$Ellipsis.html>`__ | | |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``(``\ `Expr <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$Expr.html>`__\ ``)`` | `ParenExpr <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$ParenExpr.html>`__ | | |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `Ident <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$Ident.html>`__\ ``.``\ `Ident <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$Ident.html>`__ | `SelectorExpr <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$SelectorExpr.html>`__ | | |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| `Expr <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$Expr.html>`__\ ``[``\ `Expr <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$Expr.html>`__\ ``]`` | `IndexExpr <https://help.semmle.com/qldoc/go/semmle/go/Expr.qll/type.Expr$IndexExpr.html>`__ | | |
Expand Down
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