Commit 895d0743 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[test/fuzzer] Fix cpplint complaints

After this CL, we will enable cpplint checks for this directory on
presubmit: https://chromium-review.googlesource.com/647807

R=mstarzinger@chromium.org

Change-Id: Ie85e876a7245cc5c8d5bf9348c8841040a8edbe9
Reviewed-on: https://chromium-review.googlesource.com/647552Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47791}
parent 84c2dfce
......@@ -53,8 +53,9 @@ FuzzerSupport::FuzzerSupport(int* argc, char*** argv) {
FuzzerSupport::~FuzzerSupport() {
{
v8::Isolate::Scope isolate_scope(isolate_);
while (PumpMessageLoop()) /* empty */
;
while (PumpMessageLoop()) {
// empty
}
v8::HandleScope handle_scope(isolate_);
context_.Reset();
......
......@@ -34,6 +34,6 @@ class FuzzerSupport {
v8::Global<v8::Context> context_;
};
} // namespace
} // namespace v8_fuzzer
#endif // TEST_FUZZER_FUZZER_SUPPORT_H_
......@@ -29,13 +29,13 @@ int main(int argc, char* argv[]) {
}
fseek(input, 0, SEEK_END);
long size = ftell(input);
size_t size = ftell(input);
fseek(input, 0, SEEK_SET);
uint8_t* data = reinterpret_cast<uint8_t*>(malloc(size));
if (!data) {
fclose(input);
fprintf(stderr, "Failed to allocate %ld bytes\n", size);
fprintf(stderr, "Failed to allocate %zu bytes\n", size);
return 1;
}
......
......@@ -6,6 +6,9 @@
#include <stddef.h>
#include <stdint.h>
#include <cctype>
#include <list>
#include "include/v8.h"
#include "src/objects-inl.h"
#include "src/objects.h"
......@@ -14,9 +17,6 @@
#include "src/parsing/preparser.h"
#include "test/fuzzer/fuzzer-support.h"
#include <cctype>
#include <list>
bool IsValidInput(const uint8_t* data, size_t size) {
std::list<char> parentheses;
const char* ptr = reinterpret_cast<const char*>(data);
......
......@@ -71,7 +71,7 @@ class WasmCallFuzzer : public WasmExecutionFuzzer {
(*argc)++;
}
virtual bool GenerateModule(
bool GenerateModule(
Isolate* isolate, Zone* zone, const uint8_t* data, size_t size,
ZoneBuffer& buffer, int32_t& num_args,
std::unique_ptr<WasmValue[]>& interpreter_args,
......
......@@ -19,7 +19,7 @@ namespace wasm {
namespace fuzzer {
class WasmCodeFuzzer : public WasmExecutionFuzzer {
virtual bool GenerateModule(
bool GenerateModule(
Isolate* isolate, Zone* zone, const uint8_t* data, size_t size,
ZoneBuffer& buffer, int32_t& num_args,
std::unique_ptr<WasmValue[]>& interpreter_args,
......
......@@ -113,7 +113,7 @@ class WasmGenerator {
}
public:
WasmGenerator(WasmFunctionBuilder* fn) : builder_(fn) {}
explicit WasmGenerator(WasmFunctionBuilder* fn) : builder_(fn) {}
void Generate(ValueType type, DataRange data);
......@@ -297,10 +297,10 @@ void WasmGenerator::Generate(ValueType type, DataRange data) {
UNREACHABLE();
}
}
}
} // namespace
class WasmCompileFuzzer : public WasmExecutionFuzzer {
virtual bool GenerateModule(
bool GenerateModule(
Isolate* isolate, Zone* zone, const uint8_t* data, size_t size,
ZoneBuffer& buffer, int32_t& num_args,
std::unique_ptr<WasmValue[]>& interpreter_args,
......
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