Commit 27a633b32a

Andrew Kelley <superjoe30@gmail.com>
2017-01-05 07:23:59
fix mem.sliceAsInt regression
1 parent 6ec6589
Changed files (1)
std/mem.zig
@@ -69,6 +69,7 @@ pub fn cmp(inline T: type, a: []const T, b: []const T) -> Cmp {
 pub fn sliceAsInt(buf: []u8, is_be: bool, inline T: type) -> T {
     var result: T = undefined;
     const result_slice = ([]u8)((&result)[0...1]);
+    set(u8, result_slice, 0);
     const padding = @sizeOf(T) - buf.len;
 
     if (is_be == @compileVar("is_big_endian")) {