From 71fec076dc596409d85a8bfaf64bc2598c5578a2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 27 Sep 2016 13:21:23 +1000 Subject: [PATCH] py/vm: Use MP_OBJ_FROM_PTR to cast a type to an object. --- py/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/vm.c b/py/vm.c index 93766bd116..363824e5f1 100644 --- a/py/vm.c +++ b/py/vm.c @@ -626,7 +626,7 @@ dispatch_loop: // stack: (..., __exit__, ctx_mgr, exc_instance) // Need to pass (exc_type, exc_instance, None) as arguments to __exit__. sp[1] = sp[0]; - sp[0] = mp_obj_get_type(sp[0]); + sp[0] = MP_OBJ_FROM_PTR(mp_obj_get_type(sp[0])); sp[2] = mp_const_none; sp -= 2; mp_obj_t ret_value = mp_call_method_n_kw(3, 0, sp);