diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index 5071fa0..d94fb34 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -1208,7 +1208,7 @@ namespace pugi
// tree node structure
xpath_ast_node* m_left;
- xpath_ast_node* m_right;
+ xpath_ast_node* m_right;
xpath_ast_node* m_third;
xpath_ast_node* m_next;
@@ -1857,7 +1857,8 @@ namespace pugi
else m_contents = 0;
}
public:
- xpath_ast_node(ast_type_t type, const char* contents, xpath_allocator& a): m_type(type), m_rettype(ast_type_none), m_contents(0)
+ xpath_ast_node(ast_type_t type, const char* contents, xpath_allocator& a): m_type(type),
+ m_rettype(ast_type_none), m_left(0), m_right(0), m_third(0), m_next(0), m_contents(0)
{
set_contents(contents, a);
}
diff --git a/tests/test_xpath_functions.cpp b/tests/test_xpath_functions.cpp
index d492da9..9cada22 100644
--- a/tests/test_xpath_functions.cpp
+++ b/tests/test_xpath_functions.cpp
@@ -47,6 +47,7 @@ TEST_XML(xpath_number_sum, "123789")
CHECK_XPATH_NUMBER(n, "sum(.)", 123789); // 123 .. 789
CHECK_XPATH_NUMBER(n, "sum(./descendant-or-self::node())", 125490); // node + 123 + child + 789 = 123789 + 123 + 789 + 789 = 125490
+ CHECK_XPATH_NUMBER(n, "sum(.//node())", 1701); // 123 + child + 789 = 123 + 789 + 789
CHECK_XPATH_NUMBER_NAN(doc.last_child(), "sum(.)");
// sum with 2 arguments
@@ -217,4 +218,27 @@ TEST_XML(xpath_boolean_lang, "123789100 should be 123789100 (?)