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

Alexander Kornienko alexfh at google.com
Mon Nov 18 04:11:02 PST 2013


  Looks good with one change in a comment.

  Do you commit access? If not, I can commit the patch for you (and make the change in the comment myself).


================
Comment at: lib/Support/YAMLTraits.cpp:118
@@ +117,3 @@
+  // when to fail until we reach this point.
+  if (!CurrentNode) {
+    if (Required)
----------------
Andrew Tulloch wrote:
> 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?
Yes, the comment needs to be clarified. Mostly by removing the description of _what_ we're doing, and leaving only _why_, e.g. "CurrentNode is null for empty documents, which is an error in the presence of required keys." or something similar. What do you think?


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



More information about the llvm-commits mailing list