From: svenpanne@chromium.org Date: Tue, 4 Feb 2014 12:23:30 +0000 (+0000) Subject: Don't access stack-allocated variable when it is out of scope. Enable Isolate cleanup... X-Git-Tag: upstream/4.7.83~10885 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c270bad71e81b6616c78c6571ff68882e603f222;p=platform%2Fupstream%2Fv8.git Don't access stack-allocated variable when it is out of scope. Enable Isolate cleanup in cctests again. R=ulan@chromium.org Review URL: https://codereview.chromium.org/146973005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19068 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h index 6c67dd5..d9f7629 100644 --- a/test/cctest/cctest.h +++ b/test/cctest/cctest.h @@ -131,8 +131,7 @@ class CcTest { v8::Isolate* isolate = CcTest::isolate()); static void TearDown() { - // TODO(svenpanne) Enable this when our cctests are fixed. - // if (isolate_ != NULL) isolate_->Dispose(); + if (isolate_ != NULL) isolate_->Dispose(); } private: diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index 2ff92ea..f473f5c 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -737,14 +737,13 @@ TEST(MakingExternalUnalignedAsciiString) { CcTest::heap()->CollectGarbage(i::NEW_SPACE); // in old gen now // Turn into external string with unaligned resource data. - int dispose_count = 0; const char* c_cons = "_abcdefghijklmnopqrstuvwxyz"; bool success = cons->MakeExternal( - new TestAsciiResource(i::StrDup(c_cons), &dispose_count, 1)); + new TestAsciiResource(i::StrDup(c_cons), NULL, 1)); CHECK(success); const char* c_slice = "_bcdefghijklmnopqrstuvwxyz"; success = slice->MakeExternal( - new TestAsciiResource(i::StrDup(c_slice), &dispose_count, 1)); + new TestAsciiResource(i::StrDup(c_slice), NULL, 1)); CHECK(success); // Trigger GCs and force evacuation.