Index: src/compiler/code-assembler.cc |
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc |
index b9d11af4874366c725dca1f900ff44a12095ec8c..9bc40258c8150fed693870f43e62a3ca89d79767 100644 |
--- a/src/compiler/code-assembler.cc |
+++ b/src/compiler/code-assembler.cc |
@@ -600,10 +600,12 @@ class CodeAssembler::Variable::Impl : public ZoneObject { |
CodeAssembler::Variable::Variable(CodeAssembler* assembler, |
MachineRepresentation rep) |
- : impl_(new (assembler->zone()) Impl(rep)) { |
- assembler->variables_.push_back(impl_); |
+ : impl_(new (assembler->zone()) Impl(rep)), assembler_(assembler) { |
+ assembler->variables_.insert(impl_); |
} |
+CodeAssembler::Variable::~Variable() { assembler_->variables_.erase(impl_); } |
+ |
void CodeAssembler::Variable::Bind(Node* value) { impl_->value_ = value; } |
Node* CodeAssembler::Variable::value() const { |