summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/YAMLParserTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix null dereference in yaml::Document::skipThomas Finch2019-11-111-0/+11
| | | | | | | | | | | | | | | | Summary: The attached test case replicates a null dereference crash in `yaml::Document::skip()`. This was fixed by adding a check and early return in the method. Reviewers: Bigcheese, hintonda, beanz Reviewed By: hintonda Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69974
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [YAMLParser] Don't crash on null keys in KeyValueNodes.Benjamin Kramer2017-11-231-0/+1
| | | | | | Found by clangd-fuzzer! llvm-svn: 318935
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* [NFC] Header cleanupMehdi Amini2016-04-181-1/+0
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* Add != to YAMLParser's basic_collection_iterator.Jordan Rose2016-01-061-0/+72
| | | | | | | | | ...and mark it as merely an input_iterator rather than a forward_iterator, since it is destructive. And then rewrite == to take advantage of that. Patch by Alex Denisov! llvm-svn: 256913
* YAML: Null terminate block scalar's value.Alex Lorenz2015-05-211-0/+12
| | | | | | | | | | | | | The commit null terminates the string value in the `yaml::BlockScalarNode` class. This change is motivated by the initial MIR serialization commit (r237708) that I reverted in r237730 because the LLVM IR source from the block scalar node wasn't terminated by a null character and thus the buildbots failed on one testcase sometimes. This change enables me to recommit the reverted commit. llvm-svn: 237942
* YAML: Implement block scalar parsing.Alex Lorenz2015-05-131-0/+27
| | | | | | | | | | | | | | | | | | | | | This commit implements the parsing of YAML block scalars. Some code existed for it before, but it couldn't parse block scalars. This commit adds a new yaml node type to represent the block scalar values. This commit also deletes the 'spec-09-27' and 'spec-09-28' tests as they are identical to the test file 'spec-09-26'. This commit introduces 3 new utility functions to the YAML scanner class: `skip_s_space`, `advanceWhile` and `consumeLineBreakIfPresent`. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D9503 llvm-svn: 237314
* YAML: Fix crash in the skip method of KeyValueNode class. Alex Lorenz2015-05-061-0/+4
| | | | | | | | | | | | | This commit changes the 'skip' method in the 'KeyValueNode' class to ensure that it doesn't dereference a null pointer when calling the 'skip' method of its value child node. It also adds a unittest that ensures that the crash doesn't occur. This change is motivated by a patch that implements parsing of YAML block scalars (http://reviews.llvm.org/D9503), as one of the unittests in that patch triggered this problem. llvm-svn: 236669
* Return a std::unique_ptr when creating a new MemoryBuffer.Rafael Espindola2014-08-271-2/+2
| | | | llvm-svn: 216583
* yaml::Stream doesn't need to take ownership of the buffer.Rafael Espindola2014-08-271-1/+1
| | | | | | In fact, most users were already using the StringRef version. llvm-svn: 216575
* Convert an ownership comment with std::uinque_ptr.Rafael Espindola2014-08-171-2/+3
| | | | llvm-svn: 215855
* Test commit, remove trailing whitespaceBenjamin Foster2014-08-131-1/+1
| | | | llvm-svn: 215556
* Allow using MemoryBuffers with yaml::Stream directly.Sean Silva2012-11-191-0/+34
| | | | | | | | | | The rationale is to get YAML filenames in diagnostics from yaml::Stream::printError -- currently the filename is hard-coded as "YAML" because there's no buffer information available. Patch by Kim Gräsman! llvm-svn: 168341
* Suppress stderr noise when test case runs.Nick Kledzik2012-07-311-0/+6
| | | | llvm-svn: 161085
* Add YAML parser to Support.Michael J. Spencer2012-04-031-0/+179
llvm-svn: 153977
OpenPOWER on IntegriCloud