From 56f73e4f46a2a23b17958c68bbb878e337e8ab85 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Mon, 23 Jun 2014 14:36:26 -0700 Subject: [PATCH] Bug 1028358; followup fix on a CLOSED TREE; r=sfink --HG-- extra : rebase_source : c38ad9347fd6100e9275e08823763bccbce54c10 --- js/src/jsapi-tests/testGCHeapPostBarriers.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/src/jsapi-tests/testGCHeapPostBarriers.cpp b/js/src/jsapi-tests/testGCHeapPostBarriers.cpp index 3a1c9bcd69f..2dc982d2bda 100644 --- a/js/src/jsapi-tests/testGCHeapPostBarriers.cpp +++ b/js/src/jsapi-tests/testGCHeapPostBarriers.cpp @@ -29,20 +29,23 @@ BEGIN_TEST(testGCHeapPostBarriers) template bool -TestHeapPostBarriers(T initalObj) +TestHeapPostBarriers(T initialObj) { - CHECK(initalObj != nullptr); - CHECK(js::gc::IsInsideNursery(initalObj)); + CHECK(initialObj != nullptr); + CHECK(js::gc::IsInsideNursery(initialObj)); /* Construct Heap<> wrapper. */ JS::Heap *heapData = new JS::Heap(); CHECK(heapData); CHECK(heapData->get() == nullptr); - heapData->set(initalObj); + heapData->set(initialObj); + + /* Store the pointer as an integer so that the hazard analysis will miss it. */ + uintptr_t initialObjAsInt = uintptr_t(initialObj); /* Perform minor GC and check heap wrapper is udated with new pointer. */ js::MinorGC(cx, JS::gcreason::API); - CHECK(heapData->get() != initalObj); + CHECK(uintptr_t(heapData->get()) != initialObjAsInt); CHECK(!js::gc::IsInsideNursery(heapData->get())); /* Check object is definitely still alive. */