diff options
Diffstat (limited to 'src/Execution/Allocator.php')
| -rw-r--r-- | src/Execution/Allocator.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Execution/Allocator.php b/src/Execution/Allocator.php index 299e761..f808174 100644 --- a/src/Execution/Allocator.php +++ b/src/Execution/Allocator.php @@ -11,6 +11,8 @@ use Nsfisis\Waddiwasi\Structure\Types\GlobalType; use Nsfisis\Waddiwasi\Structure\Types\MemType; use Nsfisis\Waddiwasi\Structure\Types\RefType; use Nsfisis\Waddiwasi\Structure\Types\TableType; +use RuntimeException; +use function count; final readonly class Allocator { @@ -63,7 +65,7 @@ final readonly class Allocator ExternVals\Table::class => $m->tableAddrs[] = $externVal->addr, ExternVals\Mem::class => $m->memAddrs[] = $externVal->addr, ExternVals\Global_::class => $m->globalAddrs[] = $externVal->addr, - default => throw new \RuntimeException("unreachable"), + default => throw new RuntimeException("unreachable"), }; } @@ -102,7 +104,7 @@ final readonly class Allocator ExportDescs\Table::class => ExternVal::Table($m->tableAddrs[$export->desc->table]), ExportDescs\Mem::class => ExternVal::Mem($m->memAddrs[$export->desc->mem]), ExportDescs\Global_::class => ExternVal::Global_($m->globalAddrs[$export->desc->global]), - default => throw new \RuntimeException("unreachable"), + default => throw new RuntimeException("unreachable"), }; $m->exports[] = new ExportInst($export->name, $value); } |
