From 66d4e13e56000d63cd98d844d60b14acc59a576d Mon Sep 17 00:00:00 2001 From: thedtvn Date: Sat, 20 Jul 2024 20:59:49 +0700 Subject: [PATCH] hot fix for wasm runtime --- mbbank/__init__.py | 2 +- mbbank/wasm_helper/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mbbank/__init__.py b/mbbank/__init__.py index a125584..d1ceb49 100644 --- a/mbbank/__init__.py +++ b/mbbank/__init__.py @@ -2,4 +2,4 @@ from .mbasync import MBBankAsync from .wasm_helper import wasm_encrypt -__version__ = '0.1.6' +__version__ = '0.1.7' diff --git a/mbbank/wasm_helper/__init__.py b/mbbank/wasm_helper/__init__.py index 0902827..2bd29b0 100644 --- a/mbbank/wasm_helper/__init__.py +++ b/mbbank/wasm_helper/__init__.py @@ -88,6 +88,8 @@ def storeValue(addr, v=undefined): obj_id = len(self._values) if obj_id >= len(self._values): self._values.extend([undefined for _ in range(obj_id - len(self._values) + 1)]) + if obj_id >= len(self._goRefCounts): + self._goRefCounts.extend([float("inf") for _ in range(obj_id - len(self._goRefCounts) + 1)]) self._values[obj_id] = v self._goRefCounts[obj_id] = 0 self._ids.setdefault(v, obj_id)