Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: src/compiler/code-assembler.cc

Issue 2035683002: [turbofan] Fix assert caused by bogus merging of out-of-scope CodeAssembler variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-assembler.h ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/compiler/code-assembler.h ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698