Browse Source

py: Raise exception for unimplemented byte codes.

pull/452/head
Damien George 11 years ago
parent
commit
e753d916c0
  1. 11
      py/vm.c

11
py/vm.c

@ -639,8 +639,10 @@ unwind_jump:
obj1 = TOP(); obj1 = TOP();
SET_TOP(mp_obj_new_slice(obj1, obj2, NULL)); SET_TOP(mp_obj_new_slice(obj1, obj2, NULL));
} else { } else {
printf("3-argument slice is not supported\n"); obj1 = mp_obj_new_exception_msg(&mp_type_NotImplementedError, "3-argument slice is not supported");
assert(0); nlr_pop();
fastn[0] = obj1;
return MP_VM_RETURN_EXCEPTION;
} }
break; break;
#endif #endif
@ -833,9 +835,10 @@ yield:
default: default:
printf("code %p, byte code 0x%02x not implemented\n", ip, op); printf("code %p, byte code 0x%02x not implemented\n", ip, op);
assert(0); obj1 = mp_obj_new_exception_msg(&mp_type_NotImplementedError, "byte code not implemented");
nlr_pop(); nlr_pop();
return MP_VM_RETURN_NORMAL; fastn[0] = obj1;
return MP_VM_RETURN_EXCEPTION;
} }
} }

Loading…
Cancel
Save