summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/OptimizeInstructions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 60222c3cd..6179833b8 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -539,9 +539,9 @@ struct OptimizeInstructions : public WalkerPass<PostWalker<OptimizeInstructions,
// shifts only use an effective amount from the constant, so adding must
// be done carefully
auto total = Bits::getEffectiveShifts(leftRight) + Bits::getEffectiveShifts(right);
- if (total == Bits::getEffectiveShifts(total, left->type)) {
+ if (total == Bits::getEffectiveShifts(total, right->type)) {
// no overflow, we can do this
- leftRight->value = LiteralUtils::makeLiteralFromInt32(total, left->type);
+ leftRight->value = LiteralUtils::makeLiteralFromInt32(total, right->type);
return left;
} // TODO: handle overflows
}