YAML: Fix crash in the skip method of KeyValueNode class.
authorAlex Lorenz <arphaman@gmail.com>
Wed, 6 May 2015 23:21:29 +0000 (23:21 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 6 May 2015 23:21:29 +0000 (23:21 +0000)
commit9daa4b18f7525087c9b4df705d793aa30e4f6417
treeca03c3c2b5aa220b41c312241be9c7a45158b60b
parenta7574638e7da2645d4e06c62bd7c190be131efca
YAML: Fix crash in the skip method of KeyValueNode class.

This commit changes the 'skip' method in the 'KeyValueNode' class
to ensure that it doesn't dereference a null pointer when calling
the 'skip' method of its value child node. It also adds a unittest
that ensures that the crash doesn't occur.

This change is motivated by a patch that implements parsing
of YAML block scalars (http://reviews.llvm.org/D9503), as one
of the unittests in that patch triggered this problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236669 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/YAMLParser.h
unittests/Support/YAMLParserTest.cpp