Revision: 22821
Author:   [email protected]
Date:     Mon Aug  4 14:17:52 2014 UTC
Log:      Fix more stack smashing bugs in test.

[email protected]
BUG=

Review URL: https://codereview.chromium.org/415403008
http://code.google.com/p/v8/source/detail?r=22821

Modified:
 /branches/bleeding_edge/test/cctest/compiler/test-simplified-lowering.cc

=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-simplified-lowering.cc Mon Aug 4 13:27:33 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/test-simplified-lowering.cc Mon Aug 4 14:17:52 2014 UTC
@@ -372,7 +372,7 @@
                  Smi::FromInt(4), Smi::FromInt(5)};

   for (size_t i = 0; i < ARRAY_SIZE(smis); i++) {    // for header sizes
-    for (size_t j = i; j < ARRAY_SIZE(smis); j++) {  // for element index
+ for (size_t j = 0; (i + j) < ARRAY_SIZE(smis); j++) { // for element index
       int offset = static_cast<int>(i * sizeof(Smi*));
       ElementAccess access = {kUntaggedBase, offset, Type::Integral32(),
                               kMachineTagged};
@@ -400,7 +400,7 @@
                  Smi::FromInt(4), Smi::FromInt(5)};

   for (size_t i = 0; i < ARRAY_SIZE(smis); i++) {    // for header sizes
-    for (size_t j = i; j < ARRAY_SIZE(smis); j++) {  // for element index
+ for (size_t j = 0; (i + j) < ARRAY_SIZE(smis); j++) { // for element index
       int offset = static_cast<int>(i * sizeof(Smi*));
       ElementAccess access = {kUntaggedBase, offset, Type::Integral32(),
                               kMachineTagged};
@@ -420,6 +420,8 @@
         CHECK_EQ(expected, t.Call(expected));
         CHECK_EQ(expected, smis[i + j]);
       }
+
+      // TODO(titzer): assert the contents of the array.
     }
   }
 }

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