Clear local (but non-argument) variables in OP_ENTER.
Otherwise, the following script prints an uninitialized value.
def f(*a)
if false
b = 15
end
p b
end
f(1,2,3)
MODIFY
src/vm.c
src/vm.c
@@ -1637,6 +1637,10 @@ RETRY_TRY_BLOCK:
}
pc += o + 1;
}
+ /* clear local (but non-argument) variables */
+ if (irep->nlocals-len-2 > 0) {
+ stack_clear(&regs[len+2], irep->nlocals-len-2);
+ }
JUMP;
}

Clear local (but non-argument) variables in OP_ENTER.

Otherwise, the following script prints an uninitialized value.

def f(*a)
  if false
    b = 15
  end
  p b
end
f(1,2,3)