Reviewers: Michael Starzinger,

Message:
Committed patchset #1 (id:1) manually as
86439b3ae31c3a21ad7f7f7b3ac1fc99378c5b45 (tree was closed).

Description:
[test] Silence array bounds warning. GCC, I think you are wrong in this case.

TBR=mstarzin...@chromium.org
BUG=

Committed:
https://chromium.googlesource.com/v8/v8/+/86439b3ae31c3a21ad7f7f7b3ac1fc99378c5b45

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -4 lines):
  M test/cctest/compiler/test-run-native-calls.cc


Index: test/cctest/compiler/test-run-native-calls.cc
diff --git a/test/cctest/compiler/test-run-native-calls.cc b/test/cctest/compiler/test-run-native-calls.cc index fa639e298dd7e98c090f764520380fabb7f0eb57..13901653b5c9ca5040b73169011b4c605128858a 100644
--- a/test/cctest/compiler/test-run-native-calls.cc
+++ b/test/cctest/compiler/test-run-native-calls.cc
@@ -365,7 +365,7 @@ class ArgsBuffer {
 template <>
 void ArgsBuffer<int32_t>::Mutate() {
   uint32_t base = 1111111111u * seed_;
-  for (int j = 0; j < count_; j++) {
+  for (int j = 0; j < count_ && j < kMaxParamCount; j++) {
     input[j] = static_cast<int32_t>(256 + base + j + seed_ * 13);
   }
   output = -1;
@@ -376,7 +376,7 @@ void ArgsBuffer<int32_t>::Mutate() {
 template <>
 void ArgsBuffer<int64_t>::Mutate() {
   uint64_t base = 11111111111111111ull * seed_;
-  for (int j = 0; j < count_; j++) {
+  for (int j = 0; j < count_ && j < kMaxParamCount; j++) {
     input[j] = static_cast<int64_t>(256 + base + j + seed_ * 13);
   }
   output = -1;
@@ -387,7 +387,7 @@ void ArgsBuffer<int64_t>::Mutate() {
 template <>
 void ArgsBuffer<float32>::Mutate() {
   float64 base = -33.25 * seed_;
-  for (int j = 0; j < count_; j++) {
+  for (int j = 0; j < count_ && j < kMaxParamCount; j++) {
     input[j] = 256 + base + j + seed_ * 13;
   }
   output = std::numeric_limits<float32>::quiet_NaN();
@@ -398,7 +398,7 @@ void ArgsBuffer<float32>::Mutate() {
 template <>
 void ArgsBuffer<float64>::Mutate() {
   float64 base = -111.25 * seed_;
-  for (int j = 0; j < count_; j++) {
+  for (int j = 0; j < count_ && j < kMaxParamCount; j++) {
     input[j] = 256 + base + j + seed_ * 13;
   }
   output = std::numeric_limits<float64>::quiet_NaN();


--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to