Initialize local variables to null

This commit is contained in:
Victorious3 2022-08-26 15:13:48 +02:00
parent 45b80bb6c5
commit 6fb329ae1a

View File

@ -810,6 +810,9 @@ public class Codegen {
generate(state, varDecl.value()); generate(state, varDecl.value());
boxPrimitive(state, varDecl.varType()); boxPrimitive(state, varDecl.varType());
mv.visitVarInsn(ASTORE, local.index()); mv.visitVarInsn(ASTORE, local.index());
} else {
mv.visitInsn(ACONST_NULL);
mv.visitVarInsn(ASTORE, local.index());
} }
break; break;
} }