YAML: Fix crash in the skip method of KeyValueNode class.
[oota-llvm.git] / include / llvm / Support / YAMLParser.h
index 3d423293b2749d8f1c0f6b434e0acd05de0ac14d..db888b816cfec69480a2d756c916cdf1203b9678 100644 (file)
@@ -253,7 +253,8 @@ public:
 
   void skip() override {
     getKey()->skip();
-    getValue()->skip();
+    if (Node *Val = getValue())
+      Val->skip();
   }
 
   static inline bool classof(const Node *N) {