Reviewers: ,

Message:
Committed patchset #1 manually as 23407 (presubmit successful).

Description:
Fix ASAN after r23404.

[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=23407

Please review this at https://codereview.chromium.org/501403002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+14, -8 lines):
  M src/compiler/generic-algorithm.h
  M test/cctest/test-spaces.cc


Index: src/compiler/generic-algorithm.h
diff --git a/src/compiler/generic-algorithm.h b/src/compiler/generic-algorithm.h index c75f9cf335f81cdfb559f4ea33db2f90b8407ffd..3e1d96e4dab9c208627f741913a290ab16c0ed08 100644
--- a/src/compiler/generic-algorithm.h
+++ b/src/compiler/generic-algorithm.h
@@ -43,7 +43,6 @@ class GenericGraphVisit {
     typedef typename Traits::Node Node;
     typedef typename Traits::Iterator Iterator;
     typedef std::pair<Iterator, Iterator> NodeState;
-    typedef zone_allocator<NodeState> ZoneNodeStateAllocator;
     typedef std::stack<NodeState, ZoneDeque<NodeState>> NodeStateStack;
     NodeStateStack stack((ZoneDeque<NodeState>(zone)));
     BoolVector visited(Traits::max_id(graph), false, zone);
Index: test/cctest/test-spaces.cc
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc
index 3c59610065d6b568f4284b1d28e10f47b1370393..27ebc76a2a44cb8c7c1e1adbfaff40d538d18f9e 100644
--- a/test/cctest/test-spaces.cc
+++ b/test/cctest/test-spaces.cc
@@ -215,13 +215,20 @@ TEST(Regress3540) {
   CodeRange* code_range = new CodeRange(isolate);
   const size_t code_range_size = 4 * MB;
   if (!code_range->SetUp(code_range_size)) return;
-  size_t allocated_size;
-  Address result;
-  for (int i = 0; i < 5; i++) {
-    result = code_range->AllocateRawMemory(
-        code_range_size - MB, code_range_size - MB, &allocated_size);
-    CHECK((result != NULL) == (i == 0));
-  }
+  Address address;
+  size_t size;
+  address = code_range->AllocateRawMemory(code_range_size - MB,
+                                          code_range_size - MB, &size);
+  CHECK(address != NULL);
+  Address null_address;
+  size_t null_size;
+  null_address = code_range->AllocateRawMemory(
+      code_range_size - MB, code_range_size - MB, &null_size);
+  CHECK(null_address == NULL);
+  code_range->FreeRawMemory(address, size);
+  delete code_range;
+  memory_allocator->TearDown();
+  delete memory_allocator;
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to