Fix incorrect string hash value extension during cross-compilation.

Previouly, having a 32-bit Android device and a 64-bit host to compile
boot.oat could lead to an interning table be fulfilled using one hash
function and be worked with using another hash function (which is caused
by sign extension).
Target case is any string with a negative .GetHashCode().

Test: test-art-host-gtest-intern_table_test

Change-Id: I3f417e1ac990ef681f0651160292130e9b3632f0
diff --git a/runtime/intern_table.cc b/runtime/intern_table.cc
index 9c05d3c..3e19146 100644
--- a/runtime/intern_table.cc
+++ b/runtime/intern_table.cc
@@ -319,7 +319,9 @@
   if (kIsDebugBuild) {
     Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
   }
-  return static_cast<size_t>(root.Read<kWithoutReadBarrier>()->GetHashCode());
+  // An additional cast to prevent undesired sign extension.
+  return static_cast<size_t>(
+      static_cast<uint32_t>(root.Read<kWithoutReadBarrier>()->GetHashCode()));
 }
 
 bool InternTable::StringHashEquals::operator()(const GcRoot<mirror::String>& a,