Skip to content

Commit

Permalink
go/ir: mark zerolog functions as exit/panic
Browse files Browse the repository at this point in the history
Fixes #793
  • Loading branch information
arp242 committed May 29, 2024
1 parent 5275b91 commit 96dcd82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions go/ir/exits.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 96dcd82

Please sign in to comment.