Skip to content

Commit 76013b2

Browse files
owen-mcCopilot
andcommitted
Go: Document defer modeling and query precision changes
Document registration-time saving, exit-time invocation, and synthetic call/result nodes in the library pack. Note precision improvements in the SSH callback and writable-file-close queries in the query pack. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d6d23c6 commit 76013b2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Improved control-flow, IR, SSA, and data-flow modeling of `defer` statements by saving evaluated callees, receivers, and arguments into synthetic temporaries at `defer` registration, reading them before deferred invocation, and saving unnamed `return` values across deferred calls. Mutations performed by deferred calls on arguments and receivers now propagate to function results and subsequent deferred calls in LIFO order rather than appearing in the function body before the `defer` runs. As a result, `CallNode.getArgument`, `CallNode.getSyntacticArgument`, `CallNode.getCalleeNode`, `MethodCallNode.getReceiver`, and `ResultNode` in functions containing `defer` may now return synthetic `InstructionNode`s rather than `ExprNode`s.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Improved the precision of the queries `go/insecure-hostkeycallback` ("Use of insecure HostKeyCallback implementation") and `go/unhandled-writable-file-close` ("Writable file handle closed without error handling"), which may lead to more results or fewer false positives.

0 commit comments

Comments
 (0)