]> granicus.if.org Git - llvm/commit
[yaml2obj] Fixing opening empty yaml files.
authorPuyan Lotfi <puyan@puyan.org>
Thu, 28 Mar 2019 22:55:08 +0000 (22:55 +0000)
committerPuyan Lotfi <puyan@puyan.org>
Thu, 28 Mar 2019 22:55:08 +0000 (22:55 +0000)
commita66a0bff8336ed3a397c02f83f66c081ae59390c
tree3231fc851dcb17383f59a9c386289d2602e64414
parent06a5e33b71ee2a276ddc6e554c77364968d8cea6
[yaml2obj] Fixing opening empty yaml files.

Essentially echo "" | yaml2obj crashes. This patch attempts to trim whitespace
and determine if the yaml string in the file is empty or not. If the input is
empty then it will not properly print out an error message and return an error
code.

Differential Revision: https://reviews.llvm.org/D59964

A    test/tools/yaml2obj/empty.yaml
M    tools/yaml2obj/yaml2obj.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357219 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/yaml2obj/empty.yaml [new file with mode: 0644]
tools/yaml2obj/yaml2obj.cpp