summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/objexcept.c4
-rw-r--r--py/showbc.c20
2 files changed, 22 insertions, 2 deletions
diff --git a/py/objexcept.c b/py/objexcept.c
index 8eb4e966e..386e72763 100644
--- a/py/objexcept.c
+++ b/py/objexcept.c
@@ -12,8 +12,8 @@
#include "objtuple.h"
// This is unified class for C-level and Python-level exceptions
-// Python-level exception have empty ->msg and all arguments are in
-// args tuple. C-level excepttion likely have ->msg and args is empty.
+// Python-level exceptions have empty ->msg and all arguments are in
+// args tuple. C-level exceptions likely have ->msg set, and args is empty.
typedef struct mp_obj_exception_t {
mp_obj_base_t base;
mp_obj_t traceback; // a list object, holding (file,line,block) as numbers (not Python objects); a hack for now
diff --git a/py/showbc.c b/py/showbc.c
index d7ae17c2e..8a1230253 100644
--- a/py/showbc.c
+++ b/py/showbc.c
@@ -215,11 +215,31 @@ void mp_byte_code_print(const byte *ip, int len) {
printf("JUMP_IF_FALSE_OR_POP " UINT_FMT, ip + unum - ip_start);
break;
+ case MP_BC_SETUP_LOOP:
+ DECODE_ULABEL; // loop labels are always forward
+ printf("SETUP_LOOP " UINT_FMT, ip + unum - ip_start);
+ break;
+
+ case MP_BC_BREAK_LOOP:
+ DECODE_ULABEL; // loop labels are always forward
+ printf("BREAK_LOOP " UINT_FMT, ip + unum - ip_start);
+ break;
+
+ case MP_BC_CONTINUE_LOOP:
+ DECODE_ULABEL; // loop labels are always forward
+ printf("CONTINUE_LOOP " UINT_FMT, ip + unum - ip_start);
+ break;
+
case MP_BC_SETUP_EXCEPT:
DECODE_ULABEL; // except labels are always forward
printf("SETUP_EXCEPT " UINT_FMT, ip + unum - ip_start);
break;
+ case MP_BC_SETUP_FINALLY:
+ DECODE_ULABEL; // except labels are always forward
+ printf("SETUP_FINALLY " UINT_FMT, ip + unum - ip_start);
+ break;
+
case MP_BC_END_FINALLY:
// if TOS is an exception, reraises the exception (3 values on TOS)
// if TOS is an integer, does something else