diff options
| author | 2024-11-25 13:54:48 +0000 | |
|---|---|---|
| committer | 2024-11-29 11:43:37 +0000 | |
| commit | 9cf1396efcb982e0ca8b9e9abace1b683bd3b359 (patch) | |
| tree | a8edeb201aa6dfb1f358a22471d6287c59f4e91e /compiler/optimizing/optimization.cc | |
| parent | f324f3ffe175d8f063bdf8a2f205171261e9443a (diff) | |
verifier: Stronger uninitialized `this` access checks.
Check uninitialized `this` field access early and make the
check more strict than before.
Ideally, two cases should be rejected now and the run-test
064-field-access is updated with the corresponding tests.
First, we no longer allow `iget` on uninitialized `this`.
Second, we do not allow iput on uninitialized `this` to
specify a field by referencing a subclass even if the
field id actually resolves to the class being verified.
However, the first case is actually something that we see
in some existing apps - they get the zero-initialized field
values from the object before the superclass constructor
call. To avoid breaking these apps, we continue to allow
such access if the class is resolved; when it's unresolved
for AOT, we reject the class and it shall be reverified at
runtime. Note that the RI would reject such access.
Note that doing this check early can also result in
reporting bad uninitialized `this` access instead of
another hard failure when both apply. It also suppresses
soft failures that would have been reported previously.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: Ieb41115e6aaf618bc283f3aebf0739b606caa3b3
Diffstat (limited to 'compiler/optimizing/optimization.cc')
0 files changed, 0 insertions, 0 deletions