diff options
author | Kenny Root <kroot@google.com> | 2015-05-14 16:48:22 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2015-05-15 00:09:16 +0000 |
commit | 788a0a157cb138c33882511ff09afacde99443b7 (patch) | |
tree | 0716f17ed249f671ee84ea82d2c149622ba902ee /runtime/interpreter | |
parent | 3beb245da9392818e3154d47593f82cf0ef69aac (diff) | |
download | art-788a0a157cb138c33882511ff09afacde99443b7.tar.gz art-788a0a157cb138c33882511ff09afacde99443b7.tar.bz2 art-788a0a157cb138c33882511ff09afacde99443b7.zip |
Fix non-range String init calls
When the String constructor was called via invoke-direct, it is changed
to the new StringFactory which is static. That means that the args need
to be shifted by one to deal with the change from non-static to static.
However, the non-range version of the invoke-direct was not shifted
correctly causing unstarted runtime initialization to get the wrong
first_dest_reg argument.
Bug: 21036900
Change-Id: Ibd7a643d877514ea396d7e4ab0dea327207cb78f
Diffstat (limited to 'runtime/interpreter')
-rw-r--r-- | runtime/interpreter/interpreter_common.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index ae67efbcd1..59d3008fc1 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -616,16 +616,17 @@ bool DoCall(ArtMethod* called_method, Thread* self, ShadowFrame& shadow_frame, uint16_t regList = inst->Fetch16(2); uint16_t count = num_ins; size_t arg_index = 0; - if (string_init) { - // Skip the referrer for the new static StringFactory call. - regList >>= 4; - ++arg_index; - } if (count == 5) { AssignRegister(new_shadow_frame, shadow_frame, first_dest_reg + 4U, (inst_data >> 8) & 0x0f); --count; - } + } + if (string_init) { + // Skip the referrer for the new static StringFactory call. + regList >>= 4; + ++first_dest_reg; + --count; + } for (; arg_index < count; ++arg_index, regList >>= 4) { AssignRegister(new_shadow_frame, shadow_frame, first_dest_reg + arg_index, regList & 0x0f); } |