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.
This commit is contained in:
Damien George
2014-04-09 15:26:46 +01:00
parent 11d8cd54c9
commit 2bf7c09222
12 changed files with 130 additions and 33 deletions

View File

@@ -123,6 +123,11 @@ void mp_byte_code_print(const byte *ip, int len) {
printf("LOAD_FAST_N " UINT_FMT, unum);
break;
case MP_BC_LOAD_FAST_CHECKED:
DECODE_UINT;
printf("LOAD_FAST_CHECKED " UINT_FMT, unum);
break;
case MP_BC_LOAD_DEREF:
DECODE_UINT;
printf("LOAD_DEREF " UINT_FMT, unum);
@@ -193,6 +198,16 @@ void mp_byte_code_print(const byte *ip, int len) {
printf("STORE_SUBSCR");
break;
case MP_BC_DELETE_FAST:
DECODE_UINT;
printf("DELETE_FAST " UINT_FMT, unum);
break;
case MP_BC_DELETE_DEREF:
DECODE_UINT;
printf("DELETE_DEREF " UINT_FMT, unum);
break;
case MP_BC_DELETE_NAME:
DECODE_QSTR;
printf("DELETE_NAME %s", qstr_str(qstr));