Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1086)

Unified Diff: test/cctest/compiler/test-run-native-calls.cc

Issue 1295323003: [test] Silence array bounds warning. GCC, I think you are wrong in this case. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698