From 2bf7c092225645d8c5b15e536afdce39e3593e42 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 9 Apr 2014 15:26:46 +0100 Subject: py: Properly implement deletion of locals and derefs, and detect errors. Needed to reinstate 2 delete opcodes, to specifically check that a local is not deleted twice. --- py/emitpass1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'py/emitpass1.c') diff --git a/py/emitpass1.c b/py/emitpass1.c index d2f7aaa53..608848941 100644 --- a/py/emitpass1.c +++ b/py/emitpass1.c @@ -91,7 +91,8 @@ STATIC void emit_pass1_store_id(emit_t *emit, qstr qstr) { } STATIC void emit_pass1_delete_id(emit_t *emit, qstr qstr) { - get_id_for_modification(emit->scope, qstr); + id_info_t *id = get_id_for_modification(emit->scope, qstr); + id->flags |= ID_FLAG_IS_DELETED; } const emit_method_table_t emit_pass1_method_table = { -- cgit v1.2.3