[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
5 files changed