Skip to content

Commit 4a314a6

Browse files
committed
extmod/re1.5: Update to 0.8.1.
Allow literal minus in char classes to be in trailing position, e.g. [a-c-]. (Previously, minus was allowed only at the start.) This increases ARM Thumb2 code size by 8 bytes.
1 parent 8edc2e4 commit 4a314a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extmod/re1.5/compilecode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
5555
for (cnt = 0; *re != ']'; re++, cnt++) {
5656
if (!*re) return NULL;
5757
EMIT(PC++, *re);
58-
if (re[1] == '-') {
58+
if (re[1] == '-' && re[2] != ']') {
5959
re += 2;
6060
}
6161
EMIT(PC++, *re);

0 commit comments

Comments
 (0)