senjuhashirama / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

contains(string,string) does assertion #203

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
xpath query: contains("X","X")

What is the expected output? 
true. 

What do you see instead?
Assertion failed: !"Wrong expression for return type string", file 
d:\prj\moon9\src\moon9\play\stage\sql\pugixml/pugixml.cpp, line 8628

Which version of pugixml are you using?
1.2

On what operating system/compiler?
Win7

Please provide any additional information below.
Patch below (pugixml.cpp):

L8886 else if (name == PUGIXML_TEXT("contains") && argc == 2)
L8887 return new (alloc_node()) xpath_ast_node(ast_func_contains, 
xpath_type_string, args[0], args[1]);

to

L8886 else if (name == PUGIXML_TEXT("contains") && argc == 2)
L8887 return new (alloc_node()) xpath_ast_node(ast_func_contains, 
xpath_type_boolean, args[0], args[1]);

Original issue reported on code.google.com by rlyeh.no...@gmail.com on 19 Mar 2013 at 2:39

GoogleCodeExporter commented 9 years ago
Thanks for the report! Fixed in r944.

Original comment by arseny.k...@gmail.com on 19 Mar 2013 at 3:15