summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-06 07:43:23 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-06 07:43:23 -0800
commit0c03dd98cb65aef0f6abe026d4efacd4247120ef (patch)
tree7ff9375c4dc160595d58974139e2445b6b4d4d11
parent71b79b7747b97d2bea6185f1149b6a273154c6fb (diff)
downloadtxr-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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/regex.c b/regex.c
index 79692803..859f9f8f 100644
--- a/regex.c
+++ b/regex.c
@@ -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);