aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Execution/Linker.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/WebAssembly/Execution/Linker.php')
-rw-r--r--src/WebAssembly/Execution/Linker.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/WebAssembly/Execution/Linker.php b/src/WebAssembly/Execution/Linker.php
index 232d924..e5321e1 100644
--- a/src/WebAssembly/Execution/Linker.php
+++ b/src/WebAssembly/Execution/Linker.php
@@ -61,51 +61,51 @@ final class Linker
{
switch ($import->desc::class) {
case ImportDescs\Func::class:
- if (!$externVal instanceof ExternVals\Func) {
- throw new LinkErrorException("incompatible import type: expected function, got " . $externVal::class);
+ if (! $externVal instanceof ExternVals\Func) {
+ throw new LinkErrorException('incompatible import type: expected function, got ' . $externVal::class);
}
$expectedType = $module->types[$import->desc->func];
$actualFunc = $this->store->funcs[$externVal->addr];
$actualType = match (true) {
$actualFunc instanceof FuncInsts\Wasm => $actualFunc->type,
$actualFunc instanceof FuncInsts\Host => $actualFunc->type,
- default => throw new LinkErrorException("unknown function instance type"),
+ default => throw new LinkErrorException('unknown function instance type'),
};
- if (!$this->functionsTypesMatch($expectedType, $actualType)) {
- throw new LinkErrorException("incompatible import type: function signature mismatch");
+ if (! $this->functionsTypesMatch($expectedType, $actualType)) {
+ throw new LinkErrorException('incompatible import type: function signature mismatch');
}
break;
case ImportDescs\Global_::class:
- if (!$externVal instanceof ExternVals\Global_) {
- throw new LinkErrorException("incompatible import type: expected global, got " . $externVal::class);
+ if (! $externVal instanceof ExternVals\Global_) {
+ throw new LinkErrorException('incompatible import type: expected global, got ' . $externVal::class);
}
$expectedType = $import->desc->global;
$actualGlobal = $this->store->globals[$externVal->addr];
- if (!$this->globalTypesMatch($expectedType, $actualGlobal->type)) {
- throw new LinkErrorException("incompatible import type: global type mismatch");
+ if (! $this->globalTypesMatch($expectedType, $actualGlobal->type)) {
+ throw new LinkErrorException('incompatible import type: global type mismatch');
}
break;
case ImportDescs\Table::class:
- if (!$externVal instanceof ExternVals\Table) {
- throw new LinkErrorException("incompatible import type: expected table, got " . $externVal::class);
+ if (! $externVal instanceof ExternVals\Table) {
+ throw new LinkErrorException('incompatible import type: expected table, got ' . $externVal::class);
}
$expectedType = $import->desc->table;
$actualTable = $this->store->tables[$externVal->addr];
- if (!$this->tableTypesMatch($expectedType, $actualTable->type)) {
- throw new LinkErrorException("incompatible import type: table type mismatch");
+ if (! $this->tableTypesMatch($expectedType, $actualTable->type)) {
+ throw new LinkErrorException('incompatible import type: table type mismatch');
}
break;
case ImportDescs\Mem::class:
- if (!$externVal instanceof ExternVals\Mem) {
- throw new LinkErrorException("incompatible import type: expected memory, got " . $externVal::class);
+ if (! $externVal instanceof ExternVals\Mem) {
+ throw new LinkErrorException('incompatible import type: expected memory, got ' . $externVal::class);
}
$expectedType = $import->desc->mem;
$actualMem = $this->store->mems[$externVal->addr];
- if (!$this->memTypesMatch($expectedType, $actualMem->type)) {
- throw new LinkErrorException("incompatible import type: memory type mismatch");
+ if (! $this->memTypesMatch($expectedType, $actualMem->type)) {
+ throw new LinkErrorException('incompatible import type: memory type mismatch');
}
break;
}