logoalt Hacker News

ks2048today at 7:11 PM4 repliesview on HN

No doubt fuzzers (vibecoded or otherwise) can be powerful, but can't you just mark all "/" as potential divide by zero errors?

I guess sometimes developers think they "know" some variable won't be zero, but unless it checked explicitly or by the compiler, that shouldn't be trusted.


Replies

Someonetoday at 7:29 PM

> but can't you just mark all "/" as potential divide by zero errors?

If you’re accepting large false positives rates: yes.

If you want users to take your warnings serious: no.

(Nitpick: you certainly don’t want to flag _all_ of them. Divisions by non-zero constants definitely should be excluded, for example (integer division by -1 can lead to overflow, but that would be a different warning))

saghmtoday at 7:32 PM

Fuzzers find inputs, not just "potential" errors that aren't triggerable.

doogliustoday at 7:20 PM

What are you suggesting and how would it be different than how SIGFPE already works?

wvbdmptoday at 7:17 PM

I mean there could be a guard clause? But yeah, seems like this could be statically evaluated like how some IDEs see a null check and don’t complain about nullability within the same scope.