From 9d136537041833506b7cb1fb6a19bd847ad564b9 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 26 Jul 2024 01:27:06 +0900 Subject: [PATCH] memory_getptr2: fix an assertion --- lib/exec_insn_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/exec_insn_subr.c b/lib/exec_insn_subr.c index cf954ae2..85e385bd 100644 --- a/lib/exec_insn_subr.c +++ b/lib/exec_insn_subr.c @@ -45,7 +45,7 @@ memory_getptr2(struct exec_context *ctx, uint32_t memidx, uint32_t ptr, uint32_t offset, uint32_t size, void **pp, bool *movedp) { const struct instance *inst = ctx->instance; - assert(memidx < inst->module->nmems); + assert(memidx < inst->module->nmems + inst->module->nimportedmems); struct meminst *meminst = VEC_ELEM(inst->mems, memidx); assert(meminst->allocated <= (uint64_t)meminst->size_in_pages