summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-02 06:45:25 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-02 06:45:25 -0800
commit20aea3056274d54e32247061cbe3f0ebb71e9992 (patch)
treeebd47042b748a50b482875b2870b0d79b6f466f4
parent980a1c1d78d838bbc13e90053ba90e02671878ae (diff)
downloadtxr-20aea3056274d54e32247061cbe3f0ebb71e9992.tar.gz
txr-20aea3056274d54e32247061cbe3f0ebb71e9992.tar.bz2
txr-20aea3056274d54e32247061cbe3f0ebb71e9992.zip
debug_check calls are the culprit triggering lookahead
in lazy lists. Changing the semantics of the data argument so that it can just be the list. * debug.c (debug): If data is a cons, then replace it with the first item. * match.c (match_files): Pass c.data to debug_check, rather than the value of if2(consp(c.data), car(c.data)) which accesses car(c.data) whether or not we are debugging. (match_fun): Likewise.
-rw-r--r--ChangeLog14
-rw-r--r--debug.c2
-rw-r--r--match.c6
3 files changed, 18 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f3da9b17..85ffdb77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-12-02 Kaz Kylheku <kaz@kylheku.com>
+
+ debug_check calls are the culprit triggering lookahead
+ in lazy lists. Changing the semantics of the data argument
+ so that it can just be the list.
+
+ * debug.c (debug): If data is a cons, then replace it with
+ the first item.
+
+ * match.c (match_files): Pass c.data to debug_check, rather
+ than the value of if2(consp(c.data), car(c.data)) which accesses
+ car(c.data) whether or not we are debugging.
+ (match_fun): Likewise.
+
2013-12-01 Kaz Kylheku <kaz@kylheku.com>
Steps toward fixing an issue: lazy list readahead.
diff --git a/debug.c b/debug.c
index fa7c439e..ec754874 100644
--- a/debug.c
+++ b/debug.c
@@ -92,6 +92,8 @@ val debug(val form, val bindings, val data, val line, val pos, val base)
val loc = source_loc(form);
cons_bind (lineno, file, loc);
+ data = if2(consp(data), car(data));
+
if (!step_mode && !memqual(loc, breakpoints)
&& (debug_depth > next_depth))
{
diff --git a/match.c b/match.c
index 746a622c..81107598 100644
--- a/match.c
+++ b/match.c
@@ -3700,8 +3700,7 @@ repeat_spec_same_data:
{
spec_bind (specline, first_spec, c.spec);
- debug_check(first_spec, c.bindings, if2(consp(c.data), car(c.data)),
- c.data_lineno, nil, nil);
+ debug_check(first_spec, c.bindings, c.data, c.data_lineno, nil, nil);
if (consp(first_spec) && !rest(specline)) {
val sym = first(first_spec);
@@ -3809,8 +3808,7 @@ val match_fun(val name, val args, val input, val files)
debug_enter;
- debug_check(call, c.bindings, if2(consp(c.data), car(c.data)),
- c.data_lineno, nil, nil);
+ debug_check(call, c.bindings, c.data, c.data_lineno, nil, nil);
ret = v_fun(&c);