fix check-statement-is-void. add tests

see #291
This commit is contained in:
Josh Wolfe
2017-04-23 21:49:42 -07:00
parent c6605cba83
commit ac7971122d
3 changed files with 33 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ fn getString(st: &ElfStackTrace, offset: u64) -> %[]u8 {
fn readAllocBytes(in_stream: &io.InStream, size: usize) -> %[]u8 {
const buf = %return global_allocator.alloc(u8, size);
%defer global_allocator.free(buf);
if (size < %return in_stream.read(buf)) return error.Eof;
if ((%return in_stream.read(buf)) < size) return error.Eof;
return buf;
}