From c7ff0b98146693b60a3f075818f96764f646b2d5 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 29 Jul 2022 22:41:17 -0700 Subject: Fix the bytecode interpreter. I'm too scared to actually try to run it right now. --- bytecode/src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'bytecode/src/main.rs') diff --git a/bytecode/src/main.rs b/bytecode/src/main.rs index 683ff26..8315d5a 100644 --- a/bytecode/src/main.rs +++ b/bytecode/src/main.rs @@ -3,12 +3,8 @@ mod data; mod encoding; mod heap; -use std::io::Read; - fn main() { - let mut buf = Vec::new(); - std::io::stdin().lock().read_to_end(&mut buf).unwrap(); - let prog = encoding::decode(&buf).unwrap(); + let prog = encoding::decode(&mut std::io::stdin().lock()).unwrap(); let exit_code = bytecode::eval(&prog).unwrap(); std::process::exit(i32::from(exit_code)); } -- cgit v1.3.1