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

Unified Diff: test/cctest/test-spaces.cc

Issue 501403002: Fix ASAN after r23404. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/generic-algorithm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/compiler/generic-algorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698