Add a test to 536-checker-needs-access-check.
We are currently not inlining methods that failed access
checks during verification (soft-fail) but we're planning to
remove those checks from the verifier. Add a test case that
would expose a dex2oatd crash when we do so to make sure we
fix the crash when or before relaxing the verification.
Test: testrunner.py --host --optimizing -t 536
Test: Repeat the above with code modification to suppress
the soft-failure in the verifier:
- const RegType& res_type = ResolveClass<CheckAccess::kYes>(dex::TypeIndex(inst->VRegB_21c()));
+ bool hack = dex_file_->PrettyMethod(dex_method_idx_, false) ==
+ "other2.GetInaccessibleClass.get";
+ const RegType& res_type = hack
+ ? ResolveClass<CheckAccess::kNo>(dex::TypeIndex(inst->VRegB_21c()))
+ : ResolveClass<CheckAccess::kYes>(dex::TypeIndex(inst->VRegB_21c()));
dex2oatd crashes:
Check failed: !is_referrers_class || !needs_access_check
Bug: 28313047
Change-Id: I00707232b6027574a57aa8d43b790e346d8fd959
5 files changed