empty NODE_BEGIN should push nil; close #496

This commit is contained in:
Yukihiro Matsumoto
2012-10-19 23:04:20 +09:00
parent 4855004711
commit 651e8b7e9c
+4
View File
@@ -951,6 +951,10 @@ codegen(codegen_scope *s, node *tree, int val)
tree = tree->cdr;
switch (nt) {
case NODE_BEGIN:
if (val && !tree) {
genop(s, MKOP_A(OP_LOADNIL, cursp()));
push();
}
while (tree) {
codegen(s, tree->car, tree->cdr ? NOVAL : val);
tree = tree->cdr;