[PATCH] [YAML] Recover gracefully when deserializing invalid YAML input.

Andrew Tulloch andrew at tullo.ch
Sun Nov 17 06:18:39 PST 2013



================
Comment at: lib/Support/YAMLTraits.cpp:118
@@ +117,3 @@
+  // when to fail until we reach this point.
+  if (!CurrentNode) {
+    if (Required)
----------------
Alexander Kornienko wrote:
> Is CurrentNode NULL only when the document is empty? Can it be NULL when parsing invalid documents?
It would be null in the case where the document is invalid, yes. In that case we would have set `EC` in `setCurrentDocument()`, and so wouldn't have reached this part of the method.  

Would you like this comment to be clarified?


http://llvm-reviews.chandlerc.com/D1236



More information about the llvm-commits mailing list