From 59c07060a6fbb93e455b44f00098cafb8e7e26cc Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 10 Oct 2014 13:03:39 -0700 Subject: Work around ICE bugs with MIPS GCC and O1. Also, work around GCC warning bugs where array accesses with explicit bounds checks are flagged as being out-of-bounds. Significantly, clean-up the HandleScope so the array accesses don't appear out-of-bounds at compile time. Change-Id: I5d66567559cc1f97cd0aa02c0df8575ebadbfe3d --- runtime/handle_scope-inl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/handle_scope-inl.h') diff --git a/runtime/handle_scope-inl.h b/runtime/handle_scope-inl.h index 7bc811db87..2717180b4d 100644 --- a/runtime/handle_scope-inl.h +++ b/runtime/handle_scope-inl.h @@ -26,9 +26,10 @@ namespace art { template inline StackHandleScope::StackHandleScope(Thread* self) - : HandleScope(kNumReferences), self_(self), pos_(0) { + : HandleScope(self->GetTopHandleScope(), kNumReferences), self_(self), pos_(0) { + COMPILE_ASSERT(kNumReferences >= 1, stack_handle_scope_must_contain_at_least_1_reference); // TODO: Figure out how to use a compile assert. - DCHECK_EQ(&references_[0], &references_storage_[0]); + CHECK_EQ(&storage_[0], GetReferences()); for (size_t i = 0; i < kNumReferences; ++i) { SetReference(i, nullptr); } -- cgit v1.2.3-59-g8ed1b