summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/YAMLTraits.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-11-28 21:38:52 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-11-28 21:38:52 +0000
commit3ab3fef2f17e35f1ab2a9bc6e28ddbc3fae27703 (patch)
tree1377eaeeba4531d4dccc572f9fad77b53f0ad2e9 /llvm/lib/Support/YAMLTraits.cpp
parentce3c8ef26e0ab8148a57810263bf3120fc6f4200 (diff)
downloadbcm5719-llvm-3ab3fef2f17e35f1ab2a9bc6e28ddbc3fae27703.tar.gz
bcm5719-llvm-3ab3fef2f17e35f1ab2a9bc6e28ddbc3fae27703.zip
Improve error handling in YAML parsing
Some scanner errors were not checked and reported by the parser. Fix PR30934. Recommit r288014 after fixing unittest. Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu> Differential Revision: https://reviews.llvm.org/D26419 llvm-svn: 288071
Diffstat (limited to 'llvm/lib/Support/YAMLTraits.cpp')
-rw-r--r--llvm/lib/Support/YAMLTraits.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index 75fac20a8ed..99d2070cb6e 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -44,13 +44,10 @@ void IO::setContext(void *Context) {
// Input
//===----------------------------------------------------------------------===//
-Input::Input(StringRef InputContent,
- void *Ctxt,
- SourceMgr::DiagHandlerTy DiagHandler,
- void *DiagHandlerCtxt)
- : IO(Ctxt),
- Strm(new Stream(InputContent, SrcMgr)),
- CurrentNode(nullptr) {
+Input::Input(StringRef InputContent, void *Ctxt,
+ SourceMgr::DiagHandlerTy DiagHandler, void *DiagHandlerCtxt)
+ : IO(Ctxt), Strm(new Stream(InputContent, SrcMgr, false, &EC)),
+ CurrentNode(nullptr) {
if (DiagHandler)
SrcMgr.setDiagHandler(DiagHandler, DiagHandlerCtxt);
DocIterator = Strm->begin();
OpenPOWER on IntegriCloud