summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorMatt Wozniski <godlygeek+git@gmail.com>2019-05-09 03:20:15 -0400
committerMatt Wozniski <godlygeek+git@gmail.com>2019-05-09 03:22:26 -0400
commitf325bd848b183f9b111b44e2fab2a9e6a366af3c (patch)
tree91f4985dc95eaa074de8d3d53d2dd3f22c2f9e7a /py/runtime.c
parent095c844004bcd8680a4bf68901adbd9cac6a4302 (diff)
Use OverflowError exception type for overflows
Initially I used one of the existing exception raise functions, but it's more correct and not much more code to raise OverflowError instead.
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 1a75a3870..9968f26e0 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1598,6 +1598,14 @@ NORETURN void mp_raise_NotImplementedError_varg(const compressed_string_t *fmt,
nlr_raise(exception);
}
+NORETURN void mp_raise_OverflowError_varg(const compressed_string_t *fmt, ...) {
+ va_list argptr;
+ va_start(argptr,fmt);
+ mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_OverflowError, fmt, argptr);
+ va_end(argptr);
+ nlr_raise(exception);
+}
+
NORETURN void mp_raise_MpyError(const compressed_string_t *msg) {
mp_raise_msg(&mp_type_MpyError, msg);
}