We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6df7b2f commit ab750eeCopy full SHA for ab750ee
1 file changed
extmod/modure.c
@@ -144,7 +144,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) {
144
}
145
146
mp_obj_t retval = mp_obj_new_list(0, NULL);
147
- const char **caps = alloca(caps_num * sizeof(char*));
+ const char **caps = mp_local_alloc(caps_num * sizeof(char*));
148
while (true) {
149
// cast is a workaround for a bug in msvc: it treats const char** as a const pointer instead of a pointer to pointer to const char
150
memset((char**)caps, 0, caps_num * sizeof(char*));
@@ -165,6 +165,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) {
165
break;
166
167
168
+ mp_local_free(caps);
169
170
mp_obj_t s = mp_obj_new_str_of_type(str_type, (const byte*)subj.begin, subj.end - subj.begin);
171
mp_obj_list_append(retval, s);
0 commit comments