From ff7307e8d4815c65317f01421dd4a116a31c6669 Mon Sep 17 00:00:00 2001 From: Gabriel Paradiso Date: Fri, 10 Jan 2025 13:06:42 +0100 Subject: [PATCH] fix: calculate the index of the slot instead of relying on the value of it --- pkg/workflows/wasm/host/wasip1.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/workflows/wasm/host/wasip1.go b/pkg/workflows/wasm/host/wasip1.go index 008c0fc4c..5103fff8b 100644 --- a/pkg/workflows/wasm/host/wasip1.go +++ b/pkg/workflows/wasm/host/wasip1.go @@ -122,9 +122,8 @@ func pollOneoff(caller *wasmtime.Caller, subscriptionptr int32, eventsptr int32, eventType := subs[inOffset+8] argBuf := subs[inOffset+8+8:] - outOffset := events[i*eventsLen] - - slot := events[outOffset:] + outOffset := i * eventsLen + slot := events[outOffset : outOffset+eventsLen] switch eventType { case eventTypeClock: // We want to stub out clock events,