================
@@ -149,6 +149,12 @@ BuiltinFunctionChecker::checkOverflow(CheckerContext &C,
SVal RetVal,
// Calling a builtin with a non-integer type result produces compiler error.
assert(Res->isIntegerType());
+ // If RetVal is unknown or undefined, we can't determine overflow
+ if (RetVal.isUnknown() || RetVal.isUndef()) {
----------------
steakhal wrote:
```suggestion
if (RetVal.isUnknownOrUndef()) {
```
My question here would be: If `RetVal` was unknown, then both `IsLeMax` and
`IsGeMin` would become unknown, which in turn would eventually return
`{true,true}` as I later elaborate from what I can tell reading this.
If `RetVal` was `Undef` then `IsLeMax` and `IsGeMin` would be also `Undef` and
the `IsLeMax.castAs<DefinedOrUnknownSVal>()` cast would trigger an assert/crash.
Consequently, I'm not convinced that `RetVal` can be `Undef` here.
https://github.com/llvm/llvm-project/pull/150225
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits