From 8a083ed74e9f4472441175e187208012927ed357 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 11 Jul 2024 03:50:50 +0900 Subject: feat: simplify ValType structure --- src/WebAssembly/Execution/Allocator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/WebAssembly/Execution/Allocator.php') diff --git a/src/WebAssembly/Execution/Allocator.php b/src/WebAssembly/Execution/Allocator.php index 67eb467..4e2adbf 100644 --- a/src/WebAssembly/Execution/Allocator.php +++ b/src/WebAssembly/Execution/Allocator.php @@ -9,8 +9,8 @@ use Nsfisis\Waddiwasi\WebAssembly\Structure\Modules\Func; use Nsfisis\Waddiwasi\WebAssembly\Structure\Modules\Module; use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\GlobalType; use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\MemType; -use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\RefType; use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\TableType; +use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType; use RuntimeException; use function count; @@ -144,9 +144,10 @@ final readonly class Allocator } /** + * @param ValType::FuncRef|ValType::ExternRef $refType * @param list $elem */ - private function allocElem(RefType $refType, array $elem): int + private function allocElem(ValType $refType, array $elem): int { $elemInst = new ElemInst($refType, $elem); $this->store->elems[] = $elemInst; -- cgit v1.2.3-70-g09d2