diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | RELNOTES | 5 | ||||
-rw-r--r-- | lib.c | 4 | ||||
-rw-r--r-- | match.c | 3 |
4 files changed, 19 insertions, 3 deletions
@@ -1,5 +1,15 @@ 2011-11-23 Kaz Kylheku <kaz@kylheku.com> + * lib.c (plus, minus): Fixed wrong assertion which would incorrectly + fire for inputs that do not overflow. + + * match.c (search_form): Fixed incorrect loop test which could + lead to nonterminating behavior. + + * RELNOTES: Updated. + +2011-11-23 Kaz Kylheku <kaz@kylheku.com> + Semantics change. If a variable is followed by a mixture of text and regular expressions, that whole mixture is considered to follow the variable and used for matching. @@ -12,6 +12,11 @@ - thus @foo bar behaves properly once again; it is not treated as foo followed by the regex / +/, ignoring the text bar. + - Infinite looping bug in negative match with longest-match semantics. + + - Bug in the overflow detection in the lib.c plus and minus function. + + (current release) TXR 042 @@ -733,7 +733,7 @@ val plus(val anum, val bnum) cnum b = c_num(bnum); numeric_assert (a <= 0 || b <= 0 || NUM_MAX - b >= a); - numeric_assert (a >= 0 || b >= 0 || NUM_MIN - b >= a); + numeric_assert (a >= 0 || b >= 0 || NUM_MIN - b <= a); return num(a + b); } @@ -745,7 +745,7 @@ val minus(val anum, val bnum) numeric_assert (b != NUM_MIN || NUM_MIN == -NUM_MAX); numeric_assert (a <= 0 || -b <= 0 || NUM_MAX + b >= a); - numeric_assert (a >= 0 || -b >= 0 || NUM_MIN + b >= a); + numeric_assert (a >= 0 || -b >= 0 || NUM_MIN + b <= a); return num(a - b); } @@ -426,7 +426,8 @@ static val search_form(match_line_ctx *c, val needle_form, val from_end) rlcp(spec, needle_form); - for (; (from_end && ge(pos, c->pos)) || length_str_ge(c->dataline, pos); + for (; (from_end && ge(pos, c->pos)) || + (!from_end && length_str_ge(c->dataline, pos)); pos = plus(pos, step)) { cons_bind (new_bindings, new_pos, |