summaryrefslogtreecommitdiff
path: root/py/emitnative.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-06-22 18:35:04 +0100
committerDamien George <damien.p.george@gmail.com>2014-06-22 18:35:04 +0100
commit780e54cdc3491409060f90003ca64fcdd3f9f1e6 (patch)
tree7376443343a4d6aa38f704a3af4dd46c73a77a49 /py/emitnative.c
parent720f55cc4bb15818b8df845e11647bbafa9709c7 (diff)
py: Implement delete_attr in native emitter.
Diffstat (limited to 'py/emitnative.c')
-rw-r--r--py/emitnative.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/py/emitnative.c b/py/emitnative.c
index 4dac5ffb0..9a36978d0 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -917,8 +917,11 @@ STATIC void emit_native_delete_global(emit_t *emit, qstr qstr) {
}
STATIC void emit_native_delete_attr(emit_t *emit, qstr qstr) {
- // not supported
- assert(0);
+ vtype_kind_t vtype_base;
+ emit_pre_pop_reg(emit, &vtype_base, REG_ARG_1); // arg1 = base
+ assert(vtype_base == VTYPE_PYOBJ);
+ emit_call_with_2_imm_args(emit, MP_F_STORE_ATTR, mp_store_attr, qstr, REG_ARG_2, (machine_uint_t)MP_OBJ_NULL, REG_ARG_3); // arg2 = attribute name, arg3 = value (null for delete)
+ emit_post(emit);
}
STATIC void emit_native_delete_subscr(emit_t *emit) {