Index: src/assembler.h |
diff --git a/src/assembler.h b/src/assembler.h |
index fd66e0bfdb111b22c74f562cae1640c191481c2f..d5822395b954acf34144d43c8128e16c926f7d45 100644 |
--- a/src/assembler.h |
+++ b/src/assembler.h |
@@ -1112,7 +1112,11 @@ class PreservePositionScope BASE_EMBEDDED { |
public: |
explicit PreservePositionScope(PositionsRecorder* positions_recorder) |
: positions_recorder_(positions_recorder), |
- saved_state_(positions_recorder->state_) {} |
+ saved_state_(positions_recorder->state_) { |
+ // Reset positions so that previous ones do not accidentally get |
+ // recorded within this scope. |
+ positions_recorder->state_ = PositionState(); |
+ } |
~PreservePositionScope() { |
positions_recorder_->state_ = saved_state_; |