fix bug for freeing vm_stack

This commit is contained in:
CismonX 2020-05-19 01:44:55 +08:00
parent d6febd352a
commit e63fb0ade4
No known key found for this signature in database
GPG Key ID: 315D6652268C5007
1 changed files with 1 additions and 0 deletions

View File

@ -76,6 +76,7 @@ vm_stack_dup(struct vm_stack* vs) {
static inline void static inline void
vm_stack_free(struct vm_stack* vs) { vm_stack_free(struct vm_stack* vs) {
struct vm_stack* prev; struct vm_stack* prev;
vs->refcnt = 1;
do { do {
prev = vs->prev; prev = vs->prev;
if (--vs->refcnt == 0) { if (--vs->refcnt == 0) {