When I conducted static analysis without core checkers, clang encountered
a crash by division by zero. The cause of the division-by-zero is
that BasicValueFactory::evalAPSInt() blindly operates divisions with
*any* known values. It means the SVal builder operates divisions even if
RHS value is zero. My fix is simply adding a RHS check before performing
the division in BasicValueFactory::evalAPSInt().
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I can reproduce using your testcode. It's a good catch. And the fix looks good to me. Does anybody else have any opinions?