Reviewers: Michael Starzinger,

Description:
Fix handlification bug in test

[email protected]
BUG=

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

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

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


Index: test/cctest/test-types.cc
diff --git a/test/cctest/test-types.cc b/test/cctest/test-types.cc
index 59a8f0851a47e44e0539513d7e87da433ec84af2..5b4e2b3d3b107c26b1e803c6ef39641a667c9894 100644
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -273,21 +273,25 @@ class Types {
         return Type::Constant(values[i], region_);
       }
       case 3:  // array
-        return Type::Array(Fuzz(depth / 2), region_);
+        TypeHandle element = Fuzz(depth / 2);
+        return Type::Array(element, region_);
       case 4:
       case 5:
       case 6: {  // function
-        TypeHandle type = Type::Function(
-            Fuzz(depth / 2), Fuzz(depth / 2), rand() % 3, region_);
+        TypeHandle result = Fuzz(depth / 2);
+        TypeHandle receiver = Fuzz(depth / 2);
+ TypeHandle type = Type::Function(result, receiver, rand() % 3, region_);
         for (int i = 0; i < type->AsFunction()->Arity(); ++i) {
-          type->AsFunction()->InitParameter(i, Fuzz(depth - 1));
+          TypeHandle parameter = Fuzz(depth - 1);
+          type->AsFunction()->InitParameter(i, parameter);
         }
       }
       default: {  // union
         int n = rng_.NextInt(10);
         TypeHandle type = None;
         for (int i = 0; i < n; ++i) {
-          type = Type::Union(type, Fuzz(depth - 1), region_);
+          TypeHandle operand = Fuzz(depth - 1);
+          type = Type::Union(type, operand, region_);
         }
         return type;
       }


--
--
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