mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 21:58:20 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -463,7 +463,7 @@ impl<'ctx> Intrinsics<'ctx> {
|
||||
|
||||
// TODO: this i64 is actually a rust usize
|
||||
vmmemory_definition_ptr_ty: context
|
||||
.struct_type(&[i8_ptr_ty_basic, i64_ty_basic], false)
|
||||
.struct_type(&[i8_ptr_ty_basic, i32_ty_basic], false)
|
||||
.ptr_type(AddressSpace::Generic),
|
||||
vmmemory_definition_base_element: 0,
|
||||
vmmemory_definition_current_length_element: 1,
|
||||
|
||||
Reference in New Issue
Block a user