diff options
author | Robin Jarry <robin@jarry.cc> | 2023-10-26 00:03:43 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-11-02 16:31:00 +0100 |
commit | 23ba54784a49fe13c665396c49a5ab3baa70ebd5 (patch) | |
tree | aa3ed90d331420a90c144c52e62a00a96062ba4c /worker/jmap | |
parent | 0b0095eeadaf7645b731f277c06e3f19e63ea981 (diff) | |
download | aerc-23ba54784a49fe13c665396c49a5ab3baa70ebd5.tar.gz |
linters: avoid crash when analyzing function call
When encountering a statement such as:
go functionName()
The identifier is not a local symbol but should be looked up in the
current package. Do not consider that all these statements will refer to
local variables.
The only way to do this is to run a second analyzer that depends on the
first one. Store all unresolved methods and functions into
a indirectCalls struct. Reuse that result in the second analyzer to
resolve the function declarations and check their bodies for the
defer log.PanicHandler() statement.
Fix one newly reported issues.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'worker/jmap')
-rw-r--r-- | worker/jmap/push.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/worker/jmap/push.go b/worker/jmap/push.go index 34a90ca4..2f7b05e6 100644 --- a/worker/jmap/push.go +++ b/worker/jmap/push.go @@ -16,6 +16,8 @@ import ( ) func (w *JMAPWorker) monitorChanges() { + defer log.PanicHandler() + events := push.EventSource{ Client: w.client, Handler: w.handleChange, |