summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/YAMLTraits.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index 75a2224a772..a80adfda830 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -160,7 +160,8 @@ bool Input::preflightKey(const char *Key, bool Required, bool, bool &UseDefault,
MapHNode *MN = dyn_cast<MapHNode>(CurrentNode);
if (!MN) {
- setError(CurrentNode, "not a mapping");
+ if (Required || !isa<EmptyHNode>(CurrentNode))
+ setError(CurrentNode, "not a mapping");
return false;
}
MN->ValidKeys.push_back(Key);
OpenPOWER on IntegriCloud