Fix more stack smashing bugs in test.

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/415403008

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22821 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
titzer@chromium.org 2014-08-04 14:17:52 +00:00
parent 0898e9ece2
commit 7a48b84856

View File

@ -372,7 +372,7 @@ TEST(RunLoadElementFromUntaggedBase) {
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 @@ TEST(RunStoreElementFromUntaggedBase) {
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 @@ TEST(RunStoreElementFromUntaggedBase) {
CHECK_EQ(expected, t.Call(expected));
CHECK_EQ(expected, smis[i + j]);
}
// TODO(titzer): assert the contents of the array.
}
}
}