cranelift: Fix shift overflow when constructing BitSet (#6020)

* Fix shift overflow when constructing the Wider constraint for integers

* Clarify comment
This commit is contained in:
Trevor Elliott
2023-03-14 15:25:51 -07:00
committed by GitHub
parent 48ecb6f119
commit 68b937d965
2 changed files with 23 additions and 12 deletions

View File

@@ -110,11 +110,12 @@ block2(v3: f32, v4: i8):
return
}
function %bad_extend() {
block0:
v0 = iconst.i32 10
v1 = uextend.i16 v0 ; error: arg 0 (v0) with type i32 failed to satisfy type set
v2 = uextend.i32 v0 ; error: arg 0 (v0) with type i32 failed to satisfy type set
function %bad_extend(i128) {
block0(v0: i128):
v1 = iconst.i32 10
v2 = uextend.i16 v1 ; error: arg 0 (v1) with type i32 failed to satisfy type set
v3 = uextend.i32 v1 ; error: arg 0 (v1) with type i32 failed to satisfy type set
v4 = uextend.i128 v0 ; error: arg 0 (v0) with type i128 failed to satisfy type set
return
}
@@ -123,6 +124,8 @@ block0:
v0 = iconst.i32 10
v1 = ireduce.i32 v0 ; error: arg 0 (v0) with type i32 failed to satisfy type set
v2 = ireduce.i64 v0 ; error: arg 0 (v0) with type i32 failed to satisfy type set
v4 = iconst.i8 10
v5 = ireduce.i64 v4 ; error: arg 0 (v4) with type i8 failed to satisfy type set
return
}