diff options
| author | 2014-07-11 14:52:06 +0000 | |
|---|---|---|
| committer | 2014-07-10 20:09:49 +0000 | |
| commit | 3641ac7de8b51c0853eaaa2ba3a3ab7e65a837c5 (patch) | |
| tree | 425daeee0978d1a551ede86422643da09fbe1f43 /runtime/reflection_test.cc | |
| parent | eab674a87b32794ae2c5e7d238292e56804de09d (diff) | |
| parent | 4e99b3d8955131f3fc71aa113f0fa71f0092cb6f (diff) | |
Merge "Add missing class initialization during compilation and tests"
Diffstat (limited to 'runtime/reflection_test.cc')
| -rw-r--r-- | runtime/reflection_test.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc index 3b66abee2a..abe68ef8d7 100644 --- a/runtime/reflection_test.cc +++ b/runtime/reflection_test.cc @@ -109,7 +109,16 @@ class ReflectionTest : public CommonCompilerTest { : c->FindVirtualMethod(method_name, method_signature); CHECK(method != nullptr); - *receiver = (is_static ? nullptr : c->AllocObject(self)); + if (is_static) { + *receiver = nullptr; + } else { + // Ensure class is initialized before allocating object + StackHandleScope<1> hs(self); + Handle<mirror::Class> h_class(hs.NewHandle(c)); + bool initialized = class_linker_->EnsureInitialized(h_class, true, true); + CHECK(initialized); + *receiver = c->AllocObject(self); + } // Start runtime. bool started = runtime_->Start(); |