@@ -265,11 +265,13 @@ private void compileIf(AST.IfElseStmt ifElseStmt) {
265265 issa .sealBlock (currentBlock );
266266 assert vstackEmpty ();
267267 startBlock (ifBlock );
268+ issa .sealBlock (ifBlock );
268269 compileStatement (ifElseStmt .ifStmt );
269270 if (!isBlockTerminated (currentBlock ))
270271 jumpTo (exitBlock );
271272 if (elseBlock != null ) {
272273 startBlock (elseBlock );
274+ issa .sealBlock (elseBlock );
273275 compileStatement (ifElseStmt .elseStmt );
274276 if (!isBlockTerminated (currentBlock ))
275277 jumpTo (exitBlock );
@@ -663,7 +665,7 @@ private void codeStoreAppend() {
663665 private void codeArg (Operand .LocalRegisterOperand target ) {
664666 var newtarget = (Operand .RegisterOperand ) issa .write (target );
665667 var insn = new Instruction .ArgInstruction (newtarget );
666- issa .recordDef (target , insn );
668+ issa .recordDef (newtarget , insn );
667669 code (insn );
668670 }
669671
@@ -694,7 +696,8 @@ private void codeCall(int newBase,
694696 Operand .RegisterOperand targetOperand ,
695697 Type .TypeFunction calleeType ,
696698 Operand .RegisterOperand ...arguments ) {
697- targetOperand = (Operand .RegisterOperand ) issa .write (targetOperand );
699+ if (targetOperand != null )
700+ targetOperand = (Operand .RegisterOperand ) issa .write (targetOperand );
698701 Operand .RegisterOperand args [] = new Operand .RegisterOperand [arguments .length ];
699702 for (int i = 0 ; i < args .length ; i ++) {
700703 args [i ] = (Operand .RegisterOperand ) issa .read (arguments [i ]);
0 commit comments