An array returns i32 for i8 and i16.

This commit is contained in:
Volker Berlin 2022-05-08 17:43:47 +02:00
parent 9acda37be4
commit 23199840c8
No known key found for this signature in database
GPG Key ID: 988423EF815BE4CB

View File

@ -1,5 +1,5 @@
/*
Copyright 2018 - 2021 Volker Berlin (i-net software)
Copyright 2018 - 2022 Volker Berlin (i-net software)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -195,9 +195,13 @@ class WasmArrayInstruction extends WasmInstruction {
case NEW_ARRAY_WITH_RTT:
return arrayType;
case GET:
return type;
case GET_S:
case GET_U:
return type instanceof ValueType ? (ValueType)type : ValueType.externref;
if( type == ValueType.i8 || type == ValueType.i16 ) {
return ValueType.i32;
}
return type;
case SET:
return null;
case LEN: