Fix undefined behavior in hash calculation.

dex_register might be >= the width of the map hash. Shifting by that
value would be undefined behavior. Constrain the value to within the
valid range.

Change-Id: I9037c5c7ec554850ba3385585aca96fde1d50387
diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h
index a73c8d7..9a9e068 100644
--- a/compiler/optimizing/stack_map_stream.h
+++ b/compiler/optimizing/stack_map_stream.h
@@ -386,7 +386,8 @@
       }
 
       entry.live_dex_registers_mask->SetBit(dex_register);
-      entry.dex_register_map_hash += (1 << dex_register);
+      entry.dex_register_map_hash +=
+        (1 << (dex_register % (sizeof(entry.dex_register_map_hash) * kBitsPerByte)));
       entry.dex_register_map_hash += static_cast<uint32_t>(value);
       entry.dex_register_map_hash += static_cast<uint32_t>(kind);
       stack_maps_.Put(stack_maps_.Size() - 1, entry);