Add verifier fallback for JVMTI Get/SetLocalVariable
The JVMTI Get/SetLocalVariable functions used to rely entirely on the
Dex DebugInfo to determine the types of each of the registers. This
could lead to problems since, to prevent possible stack corruption, we
would not allow stack modification if the data was not present.
In order to remove this restriction we will instead make use of the
method verifier to ensure the modification is sensible when the
DebugInfo is not present. Since reconstructing this information using
the verifier is quite slow (compared to reading it from a table) we
will only do this when the table is missing.
Since the verifier lacks some of the information available when
creating the DebugLocalInfo table some semantics will change depending
on if the table is present or not.
- When the DebugLocalInfo table is not present we cannot always
distinguish between floats, ints, and other single-register
primitive types. For simplicity all single-register primitive
types can be modified and read by both the Float and Int versions
of the local variable functions.
- Similarly we cannot always distinguish between long and double
- Reference types are checked against what the verifier thinks they
need to be according to type unification. This might be more or
less specific than the types recorded in the functions source code.
- Constant int/float '0' values and 'null' cannot always be
differentiated by the verifier. Therefore, one may not always be
able to modify some null or constant 0 registers.
Test: ./test.py --host
33 files changed