diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-28 23:22:58 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-28 23:22:58 -0800 |
commit | 9c70c2b50bb44aebcd2d01e605d7712492c7de0e (patch) | |
tree | 89f6b3060176eb5e1efa8ae9b69a6fc3750c504a /match.c | |
parent | 088da243fce2d4f5fca08bbce2fa27d5076d811b (diff) | |
download | txr-9c70c2b50bb44aebcd2d01e605d7712492c7de0e.tar.gz txr-9c70c2b50bb44aebcd2d01e605d7712492c7de0e.tar.bz2 txr-9c70c2b50bb44aebcd2d01e605d7712492c7de0e.zip |
* lib.c (numberp): Fix bad type check: null pointer dereference when
object is nil.
* match.c (do_match_line): Bugfix for incorrect treatment of long
lines. Must return the absolute position from the start of the original
line (plus(c->pos, c->base)), rather than just c->pos, which only
measures from the start of a line that may have been chopped by
consume_prefix.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1198,7 +1198,7 @@ static val do_match_line(match_line_ctx *c) c->specline = cdr(c->specline); } - debug_return (cons(c->bindings, c->pos)); + debug_return (cons(c->bindings, plus(c->pos, c->base))); debug_leave; } @@ -3510,7 +3510,7 @@ repeat_spec_same_data: match_line(ml_all(c.bindings, specline, dataline, zero, c.data_lineno, first(c.files)))); - if (fixnump(success) && c_num(success) < c_num(length_str(dataline))) { + if (numberp(success) && length_str_gt(dataline, success)) { debuglf(specline, lit("spec only matches line to position ~a: ~a"), success, dataline, nao); debug_return (nil); |