Signed integer optimisation; ensure expr is variable

This commit is contained in:
Daniel Marjamäki 2021-01-03 23:30:34 +01:00
parent 52491f1c53
commit 38aa0fa2f0
1 changed files with 1 additions and 1 deletions

View File

@ -254,7 +254,7 @@ void CheckType::checkIntegerOverflowOptimisations()
const Token *expr = lhs->astOperand1(); const Token *expr = lhs->astOperand1();
const Token *other = lhs->astOperand2(); const Token *other = lhs->astOperand2();
if (expr->varId() != lhs->astSibling()->varId()) if (expr->varId() == 0 || expr->varId() != lhs->astSibling()->varId())
continue; continue;
// x [+-] c cmp x // x [+-] c cmp x