diff options
| author | 2015-10-20 21:08:52 -0700 | |
|---|---|---|
| committer | 2015-10-20 21:51:19 -0700 | |
| commit | 58554b7de4b437ddef7ff550e62c8ec0b16f9264 (patch) | |
| tree | 4f728d96635f4fbd1165e780e460b1d3dd95fd62 /runtime/reflection_test.cc | |
| parent | 1d7d0ce2d6c9a7e30d311aadc7d8aa9bbd351cb8 (diff) | |
ART: Fix left-shift of negative numbers
Shifting negative numbers is undefined.
Change-Id: I0c32a3fcf372eae74507a5f2383edbfaf5c6830c
Diffstat (limited to 'runtime/reflection_test.cc')
| -rw-r--r-- | runtime/reflection_test.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc index bd89be5d17..c7c270946b 100644 --- a/runtime/reflection_test.cc +++ b/runtime/reflection_test.cc @@ -157,7 +157,8 @@ class ReflectionTest : public CommonCompilerTest { result = InvokeWithJValues(soa, receiver_ref.get(), soa.EncodeMethod(method), args); EXPECT_EQ(SCHAR_MAX, result.GetB()); - args[0].b = (SCHAR_MIN << 24) >> 24; + static_assert(SCHAR_MIN == -128, "SCHAR_MIN unexpected"); + args[0].b = SCHAR_MIN; result = InvokeWithJValues(soa, receiver_ref.get(), soa.EncodeMethod(method), args); EXPECT_EQ(SCHAR_MIN, result.GetB()); } |