diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-03-11 13:42:54 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-03-11 13:42:54 -0400 |
| commit | a909efae9fceb15957144194cf1ae646e8111bb6 (patch) | |
| tree | 0e7580ec1e9a9c88da1f6fe94ca5113684f1aa02 /std/mem.zig | |
| parent | 80e5af2be21427b8590c31e21c8e6b4cae1b7a6e (diff) | |
| parent | d633dcd07a053d76942217ca845ff2735a0ce6a2 (diff) | |
| download | zig-a909efae9fceb15957144194cf1ae646e8111bb6.tar.gz zig-a909efae9fceb15957144194cf1ae646e8111bb6.zip | |
Merge branch 'daurnimator-valgrind'
Diffstat (limited to 'std/mem.zig')
| -rw-r--r-- | std/mem.zig | 3 |
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)); } |
