diff --git a/exprtk.hpp b/exprtk.hpp index f3a53b4..131de03 100644 --- a/exprtk.hpp +++ b/exprtk.hpp @@ -5659,9 +5659,13 @@ namespace exprtk { n0_e.first = false; - if (!details::is_variable_node(n0_e.second)) + if ( + !is_variable_node(n0_e.second) && + !is_string_node (n0_e.second) + ) { delete n0_e.second; + n0_e.second = expression_node_ptr(0); } } @@ -5669,9 +5673,13 @@ namespace exprtk { n1_e.first = false; - if (!details::is_variable_node(n1_e.second)) + if ( + !is_variable_node(n1_e.second) && + !is_string_node (n1_e.second) + ) { delete n1_e.second; + n1_e.second = expression_node_ptr(0); } } } @@ -6387,7 +6395,7 @@ namespace exprtk ~generic_string_range_node() { - range_.free(); + base_range_.free(); if (branch_ && branch_deletable_) { diff --git a/readme.txt b/readme.txt index 15c3ffe..ec3f607 100644 --- a/readme.txt +++ b/readme.txt @@ -426,6 +426,9 @@ of C++ compilers: | | 3. x += y[:i + j] + 'abc' | | | 4. x += '0123456789'[2:7] | +----------+---------------------------------------------------------+ +| <=> | Swap the values of x and y. Where x and y are mutable | +| | strings. (eg: x <=> y) | ++----------+---------------------------------------------------------+ | [] | The string size operator returns the size of the string | | | being actioned. | | | eg: |