Provide class loader context to DexFile.verifyInBackground
The vdex file generated by a background verification thread for bytecode
loaded with InMemoryDexClassLoader needs to store a class loader
context. However, to be able to resolve the loaded classes, the verifier
needs to be called after the DexPathList element has been initialized.
But its initialization changes the class loader context compared to the
point where the vdex will be loaded to back an oat file, which has to be
before the DexPathList element is initialized. To this end, obtain the
class loader before element init and pass it to verifyInBackground()
after the init.
Bug: 72131483
Test: art/tools/run-libcore-tests.sh
Test: art/test.py -b -r -t 692 -t 693
Change-Id: I52a6a5b064bbc211aee8231e7ab5523746dc4591
2 files changed