| ... | @@ -627,7 +627,10 @@ test "free single-pointer to array" { | ... | @@ -627,7 +627,10 @@ test "free single-pointer to array" { |
| 627 | const allocation = try allocator.alloc(u32, 128); | 627 | const allocation = try allocator.alloc(u32, 128); |
| 628 | allocation[127] = 0; | 628 | allocation[127] = 0; |
| 629 | const ptr: *[127:0]u32 = allocation[0..127 :0]; | 629 | const ptr: *[127:0]u32 = allocation[0..127 :0]; |
| 630 | const new = try allocator.realloc(ptr, 16); | 630 | if (allocator.realloc(ptr, 16)) |new| { |
| 631 | allocator.free(new); | 631 | allocator.free(new); |
| | 632 | } else |_| { |
| | 633 | allocator.free(allocation); |
| | 634 | } |
| 632 | } | 635 | } |
| 633 | } | 636 | } |