Skip to content

Commit 38aa0fa

Browse files
committed
Signed integer optimisation; ensure expr is variable
1 parent 52491f1 commit 38aa0fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checktype.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void CheckType::checkIntegerOverflowOptimisations()
254254

255255
const Token *expr = lhs->astOperand1();
256256
const Token *other = lhs->astOperand2();
257-
if (expr->varId() != lhs->astSibling()->varId())
257+
if (expr->varId() == 0 || expr->varId() != lhs->astSibling()->varId())
258258
continue;
259259

260260
// x [+-] c cmp x

0 commit comments

Comments
 (0)