diff --git a/crates/wast/src/component/component.rs b/crates/wast/src/component/component.rs index af6f0144f5..0f63396187 100644 --- a/crates/wast/src/component/component.rs +++ b/crates/wast/src/component/component.rs @@ -211,7 +211,7 @@ impl<'a> Parse<'a> for Start<'a> { parser.parse::()?; let func = parser.parse::>()?.0; let mut args = Vec::new(); - while !parser.peek2::() { + while !parser.is_empty() && !parser.peek2::() { args.push(parser.parse()?); } let result = if !parser.is_empty() {