Skip to content

Commit 877a4f4

Browse files
authored
Merge pull request #3355 from jepler/import-builtin-submodule-crash-unix
builtinimport: Fix a crash with 'import ulab.linalg' on unix port only
2 parents 8b2ae35 + 455226f commit 877a4f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/builtinimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
488488
// afterwards.
489489
gc_collect();
490490
}
491-
if (outer_module_obj != MP_OBJ_NULL) {
491+
if (outer_module_obj != MP_OBJ_NULL && VERIFY_PTR(outer_module_obj) ) {
492492
qstr s = qstr_from_strn(mod_str + last, i - last);
493493
mp_store_attr(outer_module_obj, s, module_obj);
494494
// The above store can cause a dictionary rehash and new allocation. So,

0 commit comments

Comments
 (0)