Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index ba5b97d254e84a06e2757fa5d2840467737c7818..ac6873af182ab10d97324fea74cd060f653de510 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -2796,13 +2796,12 @@ void BytecodeGenerator::VisitCountOperation(CountOperation* expr) { |
} |
} |
- // Convert old value into a number. |
- builder()->CastAccumulatorToNumber(); |
- |
// Save result for postfix expressions. |
if (is_postfix) { |
old_value = register_allocator()->outer()->NewRegister(); |
- builder()->StoreAccumulatorInRegister(old_value); |
+ |
+ // Convert old value into a number before saving it. |
+ builder()->CastAccumulatorToNumber().StoreAccumulatorInRegister(old_value); |
} |
// Perform +1/-1 operation. |