From 58554b7de4b437ddef7ff550e62c8ec0b16f9264 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 20 Oct 2015 21:08:52 -0700 Subject: ART: Fix left-shift of negative numbers Shifting negative numbers is undefined. Change-Id: I0c32a3fcf372eae74507a5f2383edbfaf5c6830c --- runtime/reflection_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/reflection_test.cc') 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()); } -- cgit v1.2.3-59-g8ed1b