cranelift: Restrict br_table to i32 indices (#4510)
* cranelift: Restrict `br_table` to `i32` indices In #4498 it was proposed that we should only accept `i32` indices to `br_table`. The rationale for this is that larger types lead the users to a false sense of flexibility (since we don't support jump tables larger than u32's), and narrower types are not well tested paths that would be safer if we removed them. * cranelift: Reduce directly from i128 to i32 in Switch
This commit is contained in:
@@ -419,8 +419,7 @@ where
|
||||
|
||||
/// Generates a br_table into a random block
|
||||
fn generate_br_table(&mut self, builder: &mut FunctionBuilder) -> Result<()> {
|
||||
let _type = *self.u.choose(&[I8, I16, I32, I64][..])?;
|
||||
let var = self.get_variable_of_type(_type)?;
|
||||
let var = self.get_variable_of_type(I32)?; // br_table only supports I32
|
||||
let val = builder.use_var(var);
|
||||
|
||||
let valid_blocks = self.generate_valid_jumptable_target_blocks();
|
||||
|
||||
Reference in New Issue
Block a user