| ... | @@ -69,6 +69,7 @@ pub fn cmp(inline T: type, a: []const T, b: []const T) -> Cmp { | ... | @@ -69,6 +69,7 @@ pub fn cmp(inline T: type, a: []const T, b: []const T) -> Cmp { |
| 69 | pub fn sliceAsInt(buf: []u8, is_be: bool, inline T: type) -> T { | 69 | pub fn sliceAsInt(buf: []u8, is_be: bool, inline T: type) -> T { |
| 70 | var result: T = undefined; | 70 | var result: T = undefined; |
| 71 | const result_slice = ([]u8)((&result)[0...1]); | 71 | const result_slice = ([]u8)((&result)[0...1]); |
| | 72 | set(u8, result_slice, 0); |
| 72 | const padding = @sizeOf(T) - buf.len; | 73 | const padding = @sizeOf(T) - buf.len; |
| 73 | | 74 | |
| 74 | if (is_be == @compileVar("is_big_endian")) { | 75 | if (is_be == @compileVar("is_big_endian")) { |