aboutsummaryrefslogtreecommitdiff
path: root/std/mem.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-13 12:56:58 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-03-13 12:56:58 -0400
commit54edbc6815e42457cd28fa9f1b94e732504b3fc9 (patch)
tree36c97169bf0cd59326a93b8c3c0d458f94aed8a9 /std/mem.zig
parent4cb55d3af6a71467b7d4399bedb961c81e9ad3d5 (diff)
parentd495dcc3c952c99e5358d9610cf09eb856f643b0 (diff)
downloadzig-54edbc6815e42457cd28fa9f1b94e732504b3fc9.tar.gz
zig-54edbc6815e42457cd28fa9f1b94e732504b3fc9.zip
Merge remote-tracking branch 'origin/master' into llvm8
Diffstat (limited to 'std/mem.zig')
-rw-r--r--std/mem.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/std/mem.zig b/std/mem.zig
index 681054d087..28f25dcbcd 100644
--- a/std/mem.zig
+++ b/std/mem.zig
@@ -114,7 +114,8 @@ pub const Allocator = struct {
// n <= old_mem.len and the multiplication didn't overflow for that operation.
const byte_count = @sizeOf(T) * n;
- const byte_slice = self.reallocFn(self, @sliceToBytes(old_mem), byte_count, alignment) catch unreachable;
+ const old_byte_slice = @sliceToBytes(old_mem);
+ const byte_slice = self.reallocFn(self, old_byte_slice, byte_count, alignment) catch unreachable;
assert(byte_slice.len == byte_count);
return @bytesToSlice(T, @alignCast(alignment, byte_slice));
}