From 9266af0664f41b50b7ec189f5b2d387a70429098 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 29 Aug 2010 19:29:35 +0000 Subject: Fixed longjmp clobber warning in xml_parser::parse git-svn-id: http://pugixml.googlecode.com/svn/trunk@706 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 8ac5627..5158a02 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -2293,18 +2293,18 @@ namespace if (cursor != xmldoc) THROW_ERROR(status_end_element_mismatch, s); } - static xml_parse_result parse(char_t* buffer, size_t length, xml_node_struct* xmldoc, unsigned int optmsk) + static xml_parse_result parse(char_t* buffer, size_t length, xml_node_struct* root, unsigned int optmsk) { + xml_document_struct* xmldoc = static_cast(root); + // store buffer for offset_debug - static_cast(xmldoc)->buffer = buffer; + xmldoc->buffer = buffer; // early-out for empty documents if (length == 0) return make_parse_result(status_ok); // create parser on stack - xml_allocator& alloc = *static_cast(xmldoc); - - xml_parser parser(alloc); + xml_parser parser(*xmldoc); // save last character and make buffer zero-terminated (speeds up parsing) char_t endch = buffer[length - 1]; @@ -2321,7 +2321,7 @@ namespace xml_parse_result result = make_parse_result(static_cast(error), parser.error_offset ? parser.error_offset - buffer : 0); // update allocator state - alloc = parser.alloc; + *static_cast(xmldoc) = parser.alloc; // since we removed last character, we have to handle the only possible false positive if (result && endch == '<') -- cgit v1.2.3