]> granicus.if.org Git - llvm/commit
[yaml2obj] - Don't crash on invalid inputs.
authorGeorge Rimar <grimar@accesssoftek.com>
Thu, 25 Apr 2019 09:59:55 +0000 (09:59 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Thu, 25 Apr 2019 09:59:55 +0000 (09:59 +0000)
commit774be285decbd8694421db77a9dd16a21d2ff2df
tree6e295ed725b2cf49abef6d846122dc49e67476c1
parent3919a663cf1c3da7194bffa6265413c55cd41b41
[yaml2obj] - Don't crash on invalid inputs.

yaml2obj might crash on invalid input when unable to parse the YAML.

Recently a crash with a very similar nature was fixed for an empty files.
This patch revisits the fix and does it in yaml::Input instead.
It seems to be more correct way to handle such situation.

With that crash for invalid inputs is also fixed now.

Differential revision: https://reviews.llvm.org/D61059

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359178 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ObjectYAML/ObjectYAML.cpp
lib/Support/YAMLTraits.cpp
test/tools/yaml2obj/empty-or-invalid-doc.yaml [moved from test/tools/yaml2obj/empty.yaml with 54% similarity]
tools/yaml2obj/yaml2obj.cpp