diff --git a/exprtk.hpp b/exprtk.hpp index 9a5def6..802955a 100644 --- a/exprtk.hpp +++ b/exprtk.hpp @@ -20590,8 +20590,8 @@ namespace exprtk details::is_return_node(right_branch) ) { - free_node(node_allocator_, expression); - free_node(node_allocator_,right_branch); + free_node(node_allocator_, expression); + free_node(node_allocator_, right_branch); set_error( make_error(parser_error::e_syntax, @@ -20623,7 +20623,8 @@ namespace exprtk exprtk_error_location)); } - free_node(node_allocator_,expression); + free_node(node_allocator_, expression); + free_node(node_allocator_, right_branch); return error_node(); } diff --git a/exprtk_test.cpp b/exprtk_test.cpp index dbff457..75747aa 100644 --- a/exprtk_test.cpp +++ b/exprtk_test.cpp @@ -2811,7 +2811,16 @@ inline bool run_test03() "1 v x", "1 v y", "x v 1", - "y v 1" + "y v 1", + + "(x == 'a string' )", + "(x == 'a string'[1:2] )", + "(x == 'a string' + 'b string' )", + "(x == ('a string' + 'b string')[3:5])", + "('a string' == x )", + "('a string'[1:2] == x )", + "('a string' + 'b string' == x )", + "(('a string' + 'b string')[3:5] == x)" }; const std::size_t invalid_expr_size = sizeof(invalid_expr) / sizeof(std::string);