diff options
author | Fredrik Roubert <roubert@google.com> | 2015-07-28 00:14:08 +0200 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-07-27 16:23:46 -0700 |
commit | af50e415a187190488d4694f307c23705203c53e (patch) | |
tree | b1dbb0cd27a0b73feabae818756d54ad0e2ba49b /runtime | |
parent | 458a7c7aba37bf41e40862046846fa77046ac23c (diff) | |
download | art-af50e415a187190488d4694f307c23705203c53e.zip art-af50e415a187190488d4694f307c23705203c53e.tar.gz art-af50e415a187190488d4694f307c23705203c53e.tar.bz2 |
Bugfix: Java char is 16 bits, can not be treated as boolean.
Using SetFieldBooleanVolatile() and SetFieldBoolean() happens to work
for char values that only use the lower 8 bits, but is a mistake that
was introduced by the "Add AccessibleObject and Field to mirror" commit:
https://android.googlesource.com/platform/art/+/daaf326
(cherry picked from commit 3152c82b0d33e5fb0a4aa964ea58451c72734444)
Bug:22772717
Change-Id: Iec02ba3084c992ea239ecef688d7d29c7e21ae16
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/native/java_lang_reflect_Field.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/native/java_lang_reflect_Field.cc b/runtime/native/java_lang_reflect_Field.cc index ba898c6..39c872d 100644 --- a/runtime/native/java_lang_reflect_Field.cc +++ b/runtime/native/java_lang_reflect_Field.cc @@ -253,9 +253,9 @@ ALWAYS_INLINE inline static void SetFieldValue(mirror::Object* o, mirror::Field* break; case Primitive::kPrimChar: if (is_volatile) { - o->SetFieldBooleanVolatile<false>(offset, new_value.GetC()); + o->SetFieldCharVolatile<false>(offset, new_value.GetC()); } else { - o->SetFieldBoolean<false>(offset, new_value.GetC()); + o->SetFieldChar<false>(offset, new_value.GetC()); } break; case Primitive::kPrimInt: |