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

Side by Side Diff: tools/gn/parser_fuzzer.cc

Issue 2275683002: Add a fuzzer for gn's parser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no c Created 4 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 unified diff | Download patch
« no previous file with comments | « tools/gn/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <stdint.h>
6
7 #include "tools/gn/input_file.h"
8 #include "tools/gn/parser.h"
9 #include "tools/gn/source_file.h"
10 #include "tools/gn/tokenizer.h"
11
12 extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) {
13 SourceFile source;
14 InputFile input(source);
15 input.SetContents(std::string(reinterpret_cast<const char*>(data), size));
16
17 Err err;
18 std::vector<Token> tokens = Tokenizer::Tokenize(&input, &err);
19
20 if (!err.has_error())
21 Parser::Parse(tokens, &err);
22
23 return 0;
24 }
OLDNEW
« no previous file with comments | « tools/gn/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698