[PATCH] D85528: [analyzer] Fix cast evaluation on scoped enums in ExprEngine

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 19 04:21:04 PDT 2021


steakhal added a comment.

I really want to move this forward so I made a further evaluation on this, on the MongoDB project.
The analysis took approx. 22 and half hours on 24 cores for the baseline and for this revision as well.

There were 7116 common reports, 5 disappeared and new 34 were introduced.
We internally already landed this change more than half a year ago, and we haven't heard any complaints.
new 34:

  alpha.deadcode.UnreachableCode: 9
  alpha.security.ArrayBound: 4
  alpha.security.ReturnPtrRange: 2
  alpha.unix.cstring.OutOfBounds: 1
  deadcdoe.DeadStores: 18

disappeared 5:

  alpha.cplusplus.EnumCastOutOfRange: 1
  alpha.security.ArrayBound: 2
  alpha.security.ArrayBoundV2: 1
  core.NullDereference: 1 (infeasible)

---

In hindsight, I think we could get away with only applying the explicit cast **only if** the bitwidth wouldn't match. That way we would solve the crash in case of the Z3 crosscheck, and preserve the previous behavior otherwise.
WDYT?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85528/new/

https://reviews.llvm.org/D85528



More information about the cfe-commits mailing list