diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index b1e7e52a2..85a64f022 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -5448,6 +5448,8 @@ static void valueFlowSymbolicOperators(const SymbolDatabase& symboldatabase, con const Token* arg = tok->next()->astOperand2(); if (!arg) continue; + if (arg->exprId() == 0) + continue; ValueFlow::Value c = inferCondition(">=", arg, 0); if (!c.isKnown()) continue; diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 8a50059ef..d9faba928 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -7354,6 +7354,11 @@ private: " }\n" "}\n"; valueOfTok(code, "i"); + + code = "void f() {\n" + " if (llabs(0x80000000ffffffffL) == 0x7fffffff00000001L) {}\n" + "}\n"; + valueOfTok(code, "f"); } void valueFlowCrashConstructorInitialization() { // #9577