================
@@ -750,10 +729,8 @@ void ExprEngine::VisitLogicalExpr(const BinaryOperator* B,
ExplodedNode *Pred,
// We evaluate "RHSVal != 0" expression which result in 0 if the value is
// known to be false, 1 if the value is known to be true and a new symbol
// when the assumption is unknown.
- nonloc::ConcreteInt Zero(getBasicVals().getValue(0, B->getType()));
- X = evalBinOp(N->getState(), BO_NE,
- svalBuilder.evalCast(RHSVal, B->getType(), RHS->getType()),
- Zero, B->getType());
+ X = evalBinOp(N->getState(), BO_NE, RHSVal,
+ svalBuilder.makeZeroVal(RHS->getType()), B->getType());
----------------
steakhal wrote:
There is one more thing I don't understand. Here both `1` and `x` must decay to
`bool` for C++.
For C, these both decay into `int` - according to the AST, don't they?
https://godbolt.org/z/TdTGaPhYn
```c++
void top() {
unsigned _BitInt(63) x;
int varl = 1 && x;
}
```
So, this cast actually was the correct thing to do here, no?
https://github.com/llvm/llvm-project/pull/210525
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits