Skip to content

Commit

Permalink
go-fuzz-build: ignore invalid int literals
Browse files Browse the repository at this point in the history
Better would be to handle them.
But ignoring them is more useful than failing to build.

Fixes #246 (at least as much am I'm ever going to)
  • Loading branch information
josharian committed Dec 14, 2023
1 parent 5581da8 commit 7955ebc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go-fuzz-build/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@ func (lc *LiteralCollector) Visit(n ast.Node) (w ast.Visitor) {
if err != nil {
u, err := strconv.ParseUint(lit, 0, 64)
if err != nil {
lc.ctxt.failf("failed to parse int literal '%v': %v", lit, err)
// Instead of dying here, we just ignore the literal.
// https://github.com/dvyukov/go-fuzz/issues/246
// lc.ctxt.failf("failed to parse int literal '%v': %v", lit, err)
return nil
}
v = int64(u)
}
Expand Down

0 comments on commit 7955ebc

Please sign in to comment.