From 29793bb553547543f9c498366710b4396e1ac00c Mon Sep 17 00:00:00 2001 From: usev6 Date: Sat, 31 Mar 2018 19:33:38 +0200 Subject: [PATCH] [JVM] Fix compilation for list of void statements Fixes 'my (\x) = 42' (gave an ArrayIndexOutOfBoundException before). --- src/vm/jvm/QAST/Compiler.nqp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vm/jvm/QAST/Compiler.nqp b/src/vm/jvm/QAST/Compiler.nqp index c746ec4054..c2486870d5 100644 --- a/src/vm/jvm/QAST/Compiler.nqp +++ b/src/vm/jvm/QAST/Compiler.nqp @@ -4246,7 +4246,7 @@ class QAST::CompilerJAST { $il.append($last_res.jast) unless $void && nqp::istype($_, QAST::Var) && !nqp::istype($_, QAST::VarWithFallback); $*STACK.obtain($il, $last_res); - if $resultchild == $i && $resultchild != $n - 1 { + if !$all_void && $resultchild == $i && $resultchild != $n - 1 { $res_type := $last_res.type; $res_temp := fresh($res_type); $il.append(JAST::Instruction.new( :op(store_ins($res_type)), $res_temp ));