diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-11-06 07:43:23 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-11-06 07:43:23 -0800 |
commit | 0c03dd98cb65aef0f6abe026d4efacd4247120ef (patch) | |
tree | 7ff9375c4dc160595d58974139e2445b6b4d4d11 | |
parent | 71b79b7747b97d2bea6185f1149b6a273154c6fb (diff) | |
download | txr-0c03dd98cb65aef0f6abe026d4efacd4247120ef.tar.gz txr-0c03dd98cb65aef0f6abe026d4efacd4247120ef.tar.bz2 txr-0c03dd98cb65aef0f6abe026d4efacd4247120ef.zip |
Fix serious regression in search_regex.
* regex.c (search_regex): In the Sep 7 2015 commit
titled "Don't use prot1 for temporary gc protection",
a rel1 call was left behind, causing an assert whenever
the function is used for a succesful "from end"
search.
-rw-r--r-- | regex.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -2336,10 +2336,8 @@ val search_regex(val haystack, val needle_regex, val start, for (i = c_num(length_str(haystack)) - 1; i >= s; i--) { cnum span = regex_run(needle_regex, h + i); - if (span >= 0) { - rel1(&haystack); + if (span >= 0) return cons(num(i), num(span)); - } } gc_hint(haystack); |