From de8914e4080350b74ba9de9c8ceeef38809da8d9 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 28 Jun 2024 00:30:17 +0900 Subject: fix: some integral operations --- tests/src/SpecTestsuites/SpecTestsuiteBase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/src') diff --git a/tests/src/SpecTestsuites/SpecTestsuiteBase.php b/tests/src/SpecTestsuites/SpecTestsuiteBase.php index 06a911e..1e74e13 100644 --- a/tests/src/SpecTestsuites/SpecTestsuiteBase.php +++ b/tests/src/SpecTestsuites/SpecTestsuiteBase.php @@ -157,9 +157,9 @@ abstract class SpecTestsuiteBase extends TestCase $type = $arg['type']; $value = $arg['value']; return match ($type) { - 'i32' => unpack('l', pack('l', (int)$value))[1], + 'i32' => unpack('l', pack('V', (int)$value))[1], 'i64' => unpack('q', self::convertInt64ToBinary($value))[1], - 'f32' => unpack('g', pack('l', (int)$value))[1], + 'f32' => unpack('g', pack('V', (int)$value))[1], 'f64' => unpack('e', self::convertInt64ToBinary($value))[1], 'externref' => $value === 'null' ? Ref::RefNull(RefType::ExternRef) : Ref::RefExtern((int)$value), 'funcref' => $value === 'null' ? Ref::RefNull(RefType::FuncRef) : Ref::RefFunc((int)$value), @@ -270,6 +270,7 @@ abstract class SpecTestsuiteBase extends TestCase TrapKind::IndirectCallTypeMismatch => 'indirect call type mismatch', TrapKind::UndefinedElement => 'undefined element', TrapKind::DivideByZero => 'integer divide by zero', + TrapKind::IntegerOverflow => 'integer overflow', }; $this->assertStringContainsString( $actualErrorMessage, -- cgit v1.2.3-70-g09d2