Reviewers: dcarney,

Description:
Shut up Windows and ASAN

[email protected]
BUG=

Please review this at https://codereview.chromium.org/226883003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+9, -9 lines):
  M src/types-inl.h
  M test/cctest/test-types.cc


Index: src/types-inl.h
diff --git a/src/types-inl.h b/src/types-inl.h
index d6c69c44009f64ddf8ce29d98b11d79f37d241f4..2c805032902d0d2bc79862dd8822e3a46a6263fc 100644
--- a/src/types-inl.h
+++ b/src/types-inl.h
@@ -130,15 +130,13 @@ void ZoneTypeConfig::struct_shrink(Struct* structured, int length) {

 // static
 int ZoneTypeConfig::struct_tag(Struct* structured) {
-  int tag = reinterpret_cast<intptr_t>(structured[0]);
-  return tag;
+  return static_cast<int>(reinterpret_cast<intptr_t>(structured[0]));
 }


 // static
 int ZoneTypeConfig::struct_length(Struct* structured) {
-  int length = reinterpret_cast<intptr_t>(structured[1]);
-  return length;
+  return static_cast<int>(reinterpret_cast<intptr_t>(structured[1]));
 }


Index: test/cctest/test-types.cc
diff --git a/test/cctest/test-types.cc b/test/cctest/test-types.cc
index e45a1c7da2b72a63617db35279e59c2f0d2c745b..445a9e1a7f63fcb495c4ae4a81e7a38d1d4d404f 100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -176,10 +176,10 @@ class Types {

 // Testing auxiliaries (breaking the Type abstraction).
 struct ZoneRep {
-  struct Struct { int tag; int length; void* args[1]; };
+  typedef void* Struct;

   static bool IsStruct(Type* t, int tag) {
-    return !IsBitset(t) && AsStruct(t)->tag == tag;
+ return !IsBitset(t) && reinterpret_cast<intptr_t>(AsStruct(t)[0]) == tag;
   }
static bool IsBitset(Type* t) { return reinterpret_cast<intptr_t>(t) & 1; }
   static bool IsClass(Type* t) { return IsStruct(t, 0); }
@@ -193,15 +193,17 @@ struct ZoneRep {
     return static_cast<int>(reinterpret_cast<intptr_t>(t) >> 1);
   }
   static Map* AsClass(Type* t) {
-    return *static_cast<Map**>(AsStruct(t)->args[1]);
+    return *static_cast<Map**>(AsStruct(t)[3]);
   }
   static Object* AsConstant(Type* t) {
-    return *static_cast<Object**>(AsStruct(t)->args[1]);
+    return *static_cast<Object**>(AsStruct(t)[3]);
   }
   static Struct* AsUnion(Type* t) {
     return AsStruct(t);
   }
-  static int Length(Struct* structured) { return structured->length; }
+  static int Length(Struct* structured) {
+    return static_cast<int>(reinterpret_cast<intptr_t>(structured[1]));
+  }

   static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
 };


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to