Turn VMMemoryDefinition::current_length into a u32.

The current wasm spec limits the size to 32-bits, and attempting to use a larger size causes problems with compiler-cranelift.
This commit is contained in:
Nick Lewycky
2020-08-19 18:04:12 -07:00
parent 5a6ecd4d00
commit 8a27a2938b
8 changed files with 26 additions and 15 deletions

View File

@ -1033,6 +1033,8 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
format!("memory {} length", memory_index.as_u32()),
current_length.as_instruction_value().unwrap(),
);
let current_length =
builder.build_int_z_extend(current_length, intrinsics.i64_ty, "");
builder.build_int_compare(
IntPredicate::ULE,