summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/modre.c
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/modre.c')
-rw-r--r--extmod/modre.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/extmod/modre.c b/extmod/modre.c
index 1a118009cb..d17ec68d50 100644
--- a/extmod/modre.c
+++ b/extmod/modre.c
@@ -427,6 +427,9 @@ static mp_obj_t mod_re_compile(size_t n_args, const mp_obj_t *args) {
const char *re_str = mp_obj_str_get_str(args[0]);
int size = re1_5_sizecode(re_str);
if (size == -1) {
+ #if MICROPY_ERROR_REPORTING >= MICROPY_ERROR_REPORTING_NORMAL
+ mp_raise_ValueError(MP_ERROR_TEXT("regex too complex"));
+ #endif
goto error;
}
mp_obj_re_t *o = mp_obj_malloc_var(mp_obj_re_t, re.insts, char, size, (mp_obj_type_t *)&re_type);