fix regexp bug in unicode-category patterns

svn: r18427
This commit is contained in:
Matthew Flatt 2010-03-02 15:09:47 +00:00
parent 068dc863c4
commit fced29e946
2 changed files with 8 additions and 6 deletions

View File

@ -1580,6 +1580,8 @@
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Test unicode-property patterns
(test '((0 . 2)) regexp-match-positions #px#".\\p{L}" #"0X")
(let ([just-once? #t]
[kcrl (make-known-char-range-list)]
[ht (make-hasheq)]

View File

@ -3509,9 +3509,9 @@ regmatch(Regwork *rw, rxpos prog)
bottom = (data >> 6) & 0x3F;
top = data & 0x3F;
NEED_INPUT(rw, rw->input, 1);
if (rw->input < rw->input_end) {
c = UCHAR(rw->instr[rw->input]);
NEED_INPUT(rw, is, 1);
if (is < rw->input_end) {
c = UCHAR(rw->instr[is]);
if (c < 128) {
v = c;
pos = 1;
@ -3525,9 +3525,9 @@ regmatch(Regwork *rw, rxpos prog)
break;
} else if (v < -1)
return 0;
NEED_INPUT(rw, rw->input, pos+1);
if (rw->input + pos < rw->input_end) {
buf[pos] = rw->instr[rw->input + pos];
NEED_INPUT(rw, is, pos+1);
if (is + pos < rw->input_end) {
buf[pos] = rw->instr[is + pos];
pos++;
} else
return 0;