mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Fixed reading bad memory error
This commit is contained in:
@@ -253,6 +253,7 @@ namespace YAML
|
|||||||
throw ParserException(Mark::null(), ErrorMsg::END_OF_MAP_FLOW);
|
throw ParserException(Mark::null(), ErrorMsg::END_OF_MAP_FLOW);
|
||||||
|
|
||||||
Token& token = m_scanner.peek();
|
Token& token = m_scanner.peek();
|
||||||
|
const Mark mark = token.mark;
|
||||||
// first check for end
|
// first check for end
|
||||||
if(token.type == Token::FLOW_MAP_END) {
|
if(token.type == Token::FLOW_MAP_END) {
|
||||||
m_scanner.pop();
|
m_scanner.pop();
|
||||||
@@ -264,7 +265,7 @@ namespace YAML
|
|||||||
m_scanner.pop();
|
m_scanner.pop();
|
||||||
HandleNode(eventHandler);
|
HandleNode(eventHandler);
|
||||||
} else {
|
} else {
|
||||||
eventHandler.OnNull(token.mark, NullAnchor);
|
eventHandler.OnNull(mark, NullAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// now grab value (optional)
|
// now grab value (optional)
|
||||||
@@ -272,7 +273,7 @@ namespace YAML
|
|||||||
m_scanner.pop();
|
m_scanner.pop();
|
||||||
HandleNode(eventHandler);
|
HandleNode(eventHandler);
|
||||||
} else {
|
} else {
|
||||||
eventHandler.OnNull(token.mark, NullAnchor);
|
eventHandler.OnNull(mark, NullAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// now eat the separator (or could be a map end, which we ignore - but if it's neither, then it's a bad node)
|
// now eat the separator (or could be a map end, which we ignore - but if it's neither, then it's a bad node)
|
||||||
|
Reference in New Issue
Block a user