Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
|
brettw
2016/08/23 21:46:38
Nit: no "(c)"
| |
| 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 } | |
| OLD | NEW |