[PATCH] D38036: [yaml2obj] - Don't crash on invalid document.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 04:26:37 PDT 2017


grimar added inline comments.


================
Comment at: lib/ObjectYAML/ObjectYAML.cpp:38
+    if (!((Input &)IO).getCurrentNode())
+      return;
+
----------------
ruiu wrote:
> I think this is not correct. You need to set an error because this is an error condition.
I was not sure that empty document is an error. But ok, fixed.
In that case "Unknown document type!" message in following method looks excessive:
https://github.com/llvm-mirror/llvm/blob/master/tools/yaml2obj/yaml2obj.cpp#L48


https://reviews.llvm.org/D38036





More information about the llvm-commits mailing list