Skip to content

Commit add6f45

Browse files
committed
extmod/moductypes: set_aligned(): Handle INT64/UINT64.
1 parent 7a99639 commit add6f45

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

extmod/moductypes.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,15 @@ STATIC void set_aligned(uint val_type, void *p, mp_int_t index, mp_obj_t val) {
359359
((uint32_t*)p)[index] = (uint32_t)v; return;
360360
case INT32:
361361
((int32_t*)p)[index] = (int32_t)v; return;
362+
case INT64:
363+
case UINT64:
364+
if (sizeof(mp_int_t) == 8) {
365+
((uint64_t*)p)[index] = (uint64_t)v;
366+
} else {
367+
// TODO: Doesn't offer atomic store semantics, but should at least try
368+
set_unaligned(val_type, p, MP_ENDIANNESS_BIG, val);
369+
}
370+
return;
362371
default:
363372
assert(0);
364373
}

0 commit comments

Comments
 (0)