Acknowledge possibility of roc_alloc failing

This commit is contained in:
Richard Feldman 2022-02-02 19:22:45 -05:00
parent 9b05d8dd50
commit 778d32f6b2
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
4 changed files with 20 additions and 11 deletions

View file

@ -750,7 +750,8 @@ pub fn dictWalk(
const alignment_u32 = alignment.toU32();
// allocate space to write the result of the stepper into
// experimentally aliasing the accum and output pointers is not a good idea
const bytes_ptr: [*]u8 = utils.alloc(accum_width, alignment_u32);
// TODO handle alloc failing!
const bytes_ptr: [*]u8 = utils.alloc(accum_width, alignment_u32) orelse unreachable;
var b1 = output orelse unreachable;
var b2 = bytes_ptr;