Commit 332604d1 authored by Maya Lekova's avatar Maya Lekova Committed by V8 LUCI CQ

[test] Guard a few CHECKs against --fuzzing

Bug: chromium:1342305, chromium:1354926, chromium:1359709
Change-Id: I5ddedea227669908710b83f808cfb7c4718f0699
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3904608Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83326}
parent 75b12011
...@@ -669,11 +669,13 @@ class FastCApiObject { ...@@ -669,11 +669,13 @@ class FastCApiObject {
CHECK_NOT_NULL(self); CHECK_NOT_NULL(self);
self->fast_call_count_++; self->fast_call_count_++;
if (!i::v8_flags.fuzzing) {
// Number is in range. // Number is in range.
CHECK(in_range && "Number range should have been enforced"); CHECK(in_range && "Number range should have been enforced");
if (!std::isnan(real_arg)) { if (!std::isnan(real_arg)) {
CHECK_EQ(static_cast<IntegerT>(real_arg), checked_arg); CHECK_EQ(static_cast<IntegerT>(real_arg), checked_arg);
} }
}
return true; return true;
} }
...@@ -688,6 +690,10 @@ class FastCApiObject { ...@@ -688,6 +690,10 @@ class FastCApiObject {
HandleScope handle_scope(isolate); HandleScope handle_scope(isolate);
if (i::v8_flags.fuzzing) {
args.GetReturnValue().Set(Boolean::New(isolate, false));
return;
}
double real_arg = 0; double real_arg = 0;
if (args.Length() > 1 && args[1]->IsNumber()) { if (args.Length() > 1 && args[1]->IsNumber()) {
real_arg = args[1]->NumberValue(isolate->GetCurrentContext()).FromJust(); real_arg = args[1]->NumberValue(isolate->GetCurrentContext()).FromJust();
...@@ -776,6 +782,10 @@ class FastCApiObject { ...@@ -776,6 +782,10 @@ class FastCApiObject {
CHECK_SELF_OR_FALLBACK(false); CHECK_SELF_OR_FALLBACK(false);
self->fast_call_count_++; self->fast_call_count_++;
if (i::v8_flags.fuzzing) {
return true;
}
CHECK_NOT_NULL(options.wasm_memory); CHECK_NOT_NULL(options.wasm_memory);
uint8_t* memory = nullptr; uint8_t* memory = nullptr;
CHECK(options.wasm_memory->getStorageIfAligned(&memory)); CHECK(options.wasm_memory->getStorageIfAligned(&memory));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment