summaryrefslogtreecommitdiff
path: root/runtime/handle_scope_test.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2014-10-10 13:03:39 -0700
committer Ian Rogers <irogers@google.com> 2014-10-10 15:01:21 -0700
commit59c07060a6fbb93e455b44f00098cafb8e7e26cc (patch)
treee6db8fc4af24aa1704be0cd516d27340ae3ecae5 /runtime/handle_scope_test.cc
parentb2a7ec2ad3f24c4094185cbf87bd0a39f727ffe7 (diff)
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_test.cc')
-rw-r--r--runtime/handle_scope_test.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/handle_scope_test.cc b/runtime/handle_scope_test.cc
index 7afd279942..dc999877d0 100644
--- a/runtime/handle_scope_test.cc
+++ b/runtime/handle_scope_test.cc
@@ -25,7 +25,7 @@ namespace art {
template<size_t kNumReferences>
class NoThreadStackHandleScope : public HandleScope {
public:
- explicit NoThreadStackHandleScope() : HandleScope(kNumReferences) {
+ explicit NoThreadStackHandleScope(HandleScope* link) : HandleScope(link, kNumReferences) {
}
~NoThreadStackHandleScope() {
}
@@ -41,10 +41,8 @@ class NoThreadStackHandleScope : public HandleScope {
TEST(HandleScopeTest, Offsets) NO_THREAD_SAFETY_ANALYSIS {
// As the members of HandleScope are private, we cannot use OFFSETOF_MEMBER
// here. So do the inverse: set some data, and access it through pointers created from the offsets.
- NoThreadStackHandleScope<1> test_table;
+ NoThreadStackHandleScope<0x9ABC> test_table(reinterpret_cast<HandleScope*>(0x5678));
test_table.SetReference(0, reinterpret_cast<mirror::Object*>(0x1234));
- test_table.SetLink(reinterpret_cast<HandleScope*>(0x5678));
- test_table.SetNumberOfReferences(0x9ABC);
uint8_t* table_base_ptr = reinterpret_cast<uint8_t*>(&test_table);