summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/re1.5/compilecode.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-09-24 10:19:24 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-09-24 10:19:24 +0300
commit4a314a6f63c7157a824aa98c01009a8fbafb7475 (patch)
tree19d4e11db6ab03529d34b21b8ebd3bb1253198ce /extmod/re1.5/compilecode.c
parent8edc2e4b141ffad74754686fbdc66e033ff24f34 (diff)
downloadmicropython-4a314a6f63c7157a824aa98c01009a8fbafb7475.tar.gz
micropython-4a314a6f63c7157a824aa98c01009a8fbafb7475.zip
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.
Diffstat (limited to 'extmod/re1.5/compilecode.c')
-rw-r--r--extmod/re1.5/compilecode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/re1.5/compilecode.c b/extmod/re1.5/compilecode.c
index e4635f034a..3267a4190d 100644
--- a/extmod/re1.5/compilecode.c
+++ b/extmod/re1.5/compilecode.c
@@ -55,7 +55,7 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)
for (cnt = 0; *re != ']'; re++, cnt++) {
if (!*re) return NULL;
EMIT(PC++, *re);
- if (re[1] == '-') {
+ if (re[1] == '-' && re[2] != ']') {
re += 2;
}
EMIT(PC++, *re);