diff --git a/core/vm.c b/core/vm.c index 4f083b93..a8ad721f 100644 --- a/core/vm.c +++ b/core/vm.c @@ -254,6 +254,8 @@ PN potion_vm(Potion *P, PN proto, PN self, PN vargs, PN_SIZE upc, PN *upargs) { if (pos == 0) { reg[-1] = reg[0] = self; + if (f->localsize) + memset((void*)locals, 0, sizeof(*locals) * f->localsize); if (upc > 0 && upargs != NULL) { PN_SIZE i; for (i = 0; i < upc; i++) {