File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -235,10 +235,14 @@ typedef dreg_t dreg_gc_safe_t;
235235 case COMPACT_NBITS_VALUE :{ \
236236 int sz = (first_byte >> 5 ) + 2 ; \
237237 if (UNLIKELY (sz > 8 )) { \
238- /* TODO: when first_byte >> 5 is 7, a different encoding is used */ \
239- fprintf (stderr , "Unexpected nbits vaue @ %" PRIuPTR "\n" , (uintptr_t ) ((decode_pc ) - 1 )); \
240- AVM_ABORT (); \
241- break ; \
238+ sz = * (decode_pc ) + 9 ; \
239+ (decode_pc )++ ; \
240+ /* Integer larger than 60-bits but no bigger than 64-bits */ \
241+ /* will become boxed term taking 9 bytes (1 byte box + 64 bits)*/ \
242+ /* AtomVM can handle 64 bit int, but not larger ones until BigNum support is ready*/ \
243+ if (sz > 9 && (first_byte & 0xF ) == COMPACT_LARGE_INTEGER ) { \
244+ fprintf (stderr , "WARNING: Loading integer possibly longer than 64 bits" ); \
245+ } \
242246 } \
243247 (decode_pc ) += sz ; \
244248 break ; \
You can’t perform that action at this time.
0 commit comments