aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Execution/Allocator.php
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-11 03:50:50 +0900
committernsfisis <nsfisis@gmail.com>2024-07-11 04:14:03 +0900
commit8a083ed74e9f4472441175e187208012927ed357 (patch)
tree3686a0f61f3fccc5ded3eda28b92b8bf7765fd2f /src/WebAssembly/Execution/Allocator.php
parent26f49b7e27076e689541b9e13a1b54f60a4ee5c2 (diff)
downloadphp-waddiwasi-8a083ed74e9f4472441175e187208012927ed357.tar.gz
php-waddiwasi-8a083ed74e9f4472441175e187208012927ed357.tar.zst
php-waddiwasi-8a083ed74e9f4472441175e187208012927ed357.zip
feat: simplify ValType structure
Diffstat (limited to 'src/WebAssembly/Execution/Allocator.php')
-rw-r--r--src/WebAssembly/Execution/Allocator.php5
1 files changed, 3 insertions, 2 deletions
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<Ref> $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;