summaryrefslogtreecommitdiffstats
path: root/runtime/handle_scope-inl.h
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-10-10 13:03:39 -0700
committerIan Rogers <irogers@google.com>2014-10-10 15:01:21 -0700
commit59c07060a6fbb93e455b44f00098cafb8e7e26cc (patch)
treee6db8fc4af24aa1704be0cd516d27340ae3ecae5 /runtime/handle_scope-inl.h
parentb2a7ec2ad3f24c4094185cbf87bd0a39f727ffe7 (diff)
downloadart-59c07060a6fbb93e455b44f00098cafb8e7e26cc.zip
art-59c07060a6fbb93e455b44f00098cafb8e7e26cc.tar.gz
art-59c07060a6fbb93e455b44f00098cafb8e7e26cc.tar.bz2
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
Diffstat (limited to 'runtime/handle_scope-inl.h')
-rw-r--r--runtime/handle_scope-inl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/handle_scope-inl.h b/runtime/handle_scope-inl.h
index 7bc811d..2717180 100644
--- a/runtime/handle_scope-inl.h
+++ b/runtime/handle_scope-inl.h
@@ -26,9 +26,10 @@ namespace art {
template<size_t kNumReferences>
inline StackHandleScope<kNumReferences>::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);
}