mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Recover gracefully when deserializing invalid YAML input.
Fixes http://llvm.org/PR16221, http://llvm.org/PR15927 Phabricator: http://llvm-reviews.chandlerc.com/D1236 Patch by Andrew Tulloch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195016 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -685,16 +685,18 @@ private:
|
||||
///
|
||||
class Input : public IO {
|
||||
public:
|
||||
// Construct a yaml Input object from a StringRef and optional user-data.
|
||||
Input(StringRef InputContent, void *Ctxt=NULL);
|
||||
// Construct a yaml Input object from a StringRef and optional
|
||||
// user-data. The DiagHandler can be specified to provide
|
||||
// alternative error reporting.
|
||||
Input(StringRef InputContent,
|
||||
void *Ctxt = NULL,
|
||||
SourceMgr::DiagHandlerTy DiagHandler = NULL,
|
||||
void *DiagHandlerCtxt = NULL);
|
||||
~Input();
|
||||
|
||||
|
||||
// Check if there was an syntax or semantic error during parsing.
|
||||
llvm::error_code error();
|
||||
|
||||
// To set alternate error reporting.
|
||||
void setDiagHandler(llvm::SourceMgr::DiagHandlerTy Handler, void *Ctxt = 0);
|
||||
|
||||
static bool classof(const IO *io) { return !io->outputting(); }
|
||||
|
||||
private:
|
||||
@@ -968,8 +970,8 @@ template <typename T>
|
||||
inline
|
||||
typename llvm::enable_if_c<has_SequenceTraits<T>::value,Input &>::type
|
||||
operator>>(Input &yin, T &docSeq) {
|
||||
yin.setCurrentDocument();
|
||||
yamlize(yin, docSeq, true);
|
||||
if (yin.setCurrentDocument())
|
||||
yamlize(yin, docSeq, true);
|
||||
return yin;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user