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 @@ -224,10 +224,14 @@ typedef dreg_t dreg_gc_safe_t;
224224 case COMPACT_NBITS_VALUE :{ \
225225 int sz = (first_byte >> 5 ) + 2 ; \
226226 if (UNLIKELY (sz > 8 )) { \
227- /* TODO: when first_byte >> 5 is 7, a different encoding is used */ \
228- fprintf (stderr , "Unexpected nbits vaue @ %" PRIuPTR "\n" , (uintptr_t ) ((decode_pc ) - 1 )); \
229- AVM_ABORT (); \
230- break ; \
227+ sz = * (decode_pc ) + 9 ; \
228+ (decode_pc )++ ; \
229+ /* Integer larger than 60-bits but no bigger than 64-bits */ \
230+ /* will become boxed term taking 9 bytes (1 byte box + 64 bits)*/ \
231+ /* AtomVM can handle 64 bit int, but not larger ones until BigNum support is ready*/ \
232+ if (sz > 9 && (first_byte & 0xF ) == COMPACT_LARGE_INTEGER ) { \
233+ fprintf (stderr , "WARNING: Loading integer possibly longer than 64 bits" ); \
234+ } \
231235 } \
232236 (decode_pc ) += sz ; \
233237 break ; \
You can’t perform that action at this time.
0 commit comments