================
@@ -1490,7 +1532,7 @@ ProgramStateRef MallocChecker::ProcessZeroAllocCheck(
return State;
}
} else
- llvm_unreachable("not a CallExpr or CXXNewExpr");
+ assert(false && "not a CallExpr or CXXNewExpr");
----------------
steakhal wrote:
```suggestion
} else {
assert(false && "not a CallExpr or CXXNewExpr");
return nullptr;
}
```
Just to be on the safe side and we have a NDEBUG build (with assertions
disabled), let's avoid undefined behavior by safely backing off.
The same principle should apply to all the other cases when previously we had
an `llvm_unreachable`.
This is what I wanted to imply by `assert and return`.
https://github.com/llvm/llvm-project/pull/98941
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits