From 96dcd82cf4f7622f4efd95ceab4cb315860f6b1c Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Wed, 29 May 2024 23:48:56 +0100 Subject: [PATCH] go/ir: mark zerolog functions as exit/panic Fixes #793 --- go/ir/exits.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/go/ir/exits.go b/go/ir/exits.go index 03aa2866c..43d46b746 100644 --- a/go/ir/exits.go +++ b/go/ir/exits.go @@ -19,6 +19,13 @@ func (b *builder) buildExits(fn *Function) { fn.NoReturn = AlwaysUnwinds return } + case "github.com/rs/zerolog": + switch obj.(*types.Func).FullName() { + case "(*github.com/rs/zerolog.Logger).Fatal": + fn.NoReturn = AlwaysExits + case "(*github.com/rs/zerolog.Logger).Panic": + fn.NoReturn = AlwaysUnwinds + } case "go.uber.org/zap": switch obj.(*types.Func).FullName() { case "(*go.uber.org/zap.Logger).Fatal",