Page 1 of 1

mp_obj_new_int causing uncaught exception when value passed is greater than 30 bits

Posted: Wed Oct 31, 2018 5:20 pm
by cduran
Like the subject line says.

I'm using mp_obj_new_int to pass values between C and python. When I try to pass a number that is greater than 30 bits long I get an "uncaught exception".

Should I be using a different function for larger integers?

Re: mp_obj_new_int causing uncaught exception when value passed is greater than 30 bits

Posted: Wed Oct 31, 2018 5:38 pm
by jickster
Paste the actual code for mp_obj_new_int that you’re using. If it can’t fit in a small int, it calls
mp_obj_t mp_obj_new_int_from_ll.


And when are you getting the exception?
Are you in an interrupt?


Sent from my iPhone using Tapatalk Pro

Re: mp_obj_new_int causing uncaught exception when value passed is greater than 30 bits

Posted: Thu Nov 01, 2018 4:26 pm
by cduran
Fixed my problem.

Setting MICROPY_LONGINT_IMPL to MICROPY_LONGINT_IMPL_LONGLONG did the trick.