diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-02 17:06:05 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-02 17:06:05 +0100 |
commit | 70f33cde48524f12f2110c7daa4a874a6828314a (patch) | |
tree | 1b7796186661b7a9a96f9480997310cca046ee2f /py/runtime.c | |
parent | af6edc61bd51b58c2cac4411bd471e7cf4649a3c (diff) |
py: Fix up so that it can compile without float.
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/py/runtime.c b/py/runtime.c index 0c75d4cd3..e2e349564 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -346,8 +346,7 @@ mp_obj_t mp_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) { case MP_BINARY_OP_TRUE_DIVIDE: case MP_BINARY_OP_INPLACE_TRUE_DIVIDE: if (rhs_val == 0) { -zero_division: - nlr_jump(mp_obj_new_exception_msg(&mp_type_ZeroDivisionError, "division by zero")); + goto zero_division; } return mp_obj_new_float((mp_float_t)lhs_val / (mp_float_t)rhs_val); #endif @@ -451,6 +450,9 @@ generic_binary_op: "unsupported operand types for binary operator: '%s', '%s'", mp_obj_get_type_str(lhs), mp_obj_get_type_str(rhs))); return mp_const_none; + +zero_division: + nlr_jump(mp_obj_new_exception_msg(&mp_type_ZeroDivisionError, "division by zero")); } mp_obj_t mp_call_function_0(mp_obj_t fun) { |