diff --git a/crates/wasmtime/src/runtime/component/func.rs b/crates/wasmtime/src/runtime/component/func.rs index 9ac5329af7ce..1bfcefff8e2b 100644 --- a/crates/wasmtime/src/runtime/component/func.rs +++ b/crates/wasmtime/src/runtime/component/func.rs @@ -668,7 +668,7 @@ impl Func { results: &mut [Val], src: &mut core::slice::Iter<'_, ValRaw>, ) -> Result<()> { - // FIXME: needs to read an i64 for memory64 + // FIXME(#4311): needs to read an i64 for memory64 let ptr = usize::try_from(src.next().unwrap().get_u32())?; if ptr % usize::try_from(results_ty.abi.align32)? != 0 { bail!("return pointer not aligned"); diff --git a/crates/wasmtime/src/runtime/component/func/host.rs b/crates/wasmtime/src/runtime/component/func/host.rs index 1461554ad8a9..3ab6581959b8 100644 --- a/crates/wasmtime/src/runtime/component/func/host.rs +++ b/crates/wasmtime/src/runtime/component/func/host.rs @@ -274,7 +274,7 @@ where } fn validate_inbounds(memory: &[u8], ptr: &ValRaw) -> Result { - // FIXME: needs memory64 support + // FIXME(#4311): needs memory64 support let ptr = usize::try_from(ptr.get_u32())?; if ptr % usize::try_from(T::ALIGN32)? != 0 { bail!("pointer not aligned"); @@ -406,7 +406,7 @@ where } fn validate_inbounds_dynamic(abi: &CanonicalAbiInfo, memory: &[u8], ptr: &ValRaw) -> Result { - // FIXME: needs memory64 support + // FIXME(#4311): needs memory64 support let ptr = usize::try_from(ptr.get_u32())?; if ptr % usize::try_from(abi.align32)? != 0 { bail!("pointer not aligned"); diff --git a/crates/wasmtime/src/runtime/component/func/options.rs b/crates/wasmtime/src/runtime/component/func/options.rs index cd0482965e21..ff58df0d5277 100644 --- a/crates/wasmtime/src/runtime/component/func/options.rs +++ b/crates/wasmtime/src/runtime/component/func/options.rs @@ -52,7 +52,7 @@ unsafe impl Send for Options {} unsafe impl Sync for Options {} impl Options { - // TODO: prevent a ctor where the memory is memory64 + // FIXME(#4311): prevent a ctor where the memory is memory64 /// Creates a new set of options with the specified components. /// diff --git a/crates/wasmtime/src/runtime/component/func/typed.rs b/crates/wasmtime/src/runtime/component/func/typed.rs index 95fb52186c2a..ecd38faad558 100644 --- a/crates/wasmtime/src/runtime/component/func/typed.rs +++ b/crates/wasmtime/src/runtime/component/func/typed.rs @@ -314,7 +314,7 @@ where dst: &ValRaw, ) -> Result { assert!(Return::flatten_count() > MAX_FLAT_RESULTS); - // FIXME: needs to read an i64 for memory64 + // FIXME(#4311): needs to read an i64 for memory64 let ptr = usize::try_from(dst.get_u32())?; if ptr % usize::try_from(Return::ALIGN32)? != 0 { bail!("return pointer not aligned"); @@ -1052,7 +1052,7 @@ unsafe impl Lift for char { } } -// TODO: these probably need different constants for memory64 +// FIXME(#4311): these probably need different constants for memory64 const UTF16_TAG: usize = 1 << 31; const MAX_STRING_BYTE_LENGTH: usize = (1 << 31) - 1; @@ -1096,7 +1096,7 @@ unsafe impl Lower for str { debug_assert!(matches!(ty, InterfaceType::String)); debug_assert!(offset % (Self::ALIGN32 as usize) == 0); let (ptr, len) = lower_string(cx, self)?; - // FIXME: needs memory64 handling + // FIXME(#4311): needs memory64 handling *cx.get(offset + 0) = u32::try_from(ptr).unwrap().to_le_bytes(); *cx.get(offset + 4) = u32::try_from(len).unwrap().to_le_bytes(); Ok(()) @@ -1366,7 +1366,7 @@ unsafe impl Lift for WasmStr { #[inline] fn lift(cx: &mut LiftContext<'_>, ty: InterfaceType, src: &Self::Lower) -> Result { debug_assert!(matches!(ty, InterfaceType::String)); - // FIXME: needs memory64 treatment + // FIXME(#4311): needs memory64 treatment let ptr = src[0].get_u32(); let len = src[1].get_u32(); let (ptr, len) = (usize::try_from(ptr)?, usize::try_from(len)?); @@ -1377,7 +1377,7 @@ unsafe impl Lift for WasmStr { fn load(cx: &mut LiftContext<'_>, ty: InterfaceType, bytes: &[u8]) -> Result { debug_assert!(matches!(ty, InterfaceType::String)); debug_assert!((bytes.as_ptr() as usize) % (Self::ALIGN32 as usize) == 0); - // FIXME: needs memory64 treatment + // FIXME(#4311): needs memory64 treatment let ptr = u32::from_le_bytes(bytes[..4].try_into().unwrap()); let len = u32::from_le_bytes(bytes[4..].try_into().unwrap()); let (ptr, len) = (usize::try_from(ptr)?, usize::try_from(len)?); @@ -1670,7 +1670,7 @@ unsafe impl Lift for WasmList { InterfaceType::List(i) => cx.types[i].element, _ => bad_type_info(), }; - // FIXME: needs memory64 treatment + // FIXME(#4311): needs memory64 treatment let ptr = src[0].get_u32(); let len = src[1].get_u32(); let (ptr, len) = (usize::try_from(ptr)?, usize::try_from(len)?); @@ -1683,7 +1683,7 @@ unsafe impl Lift for WasmList { _ => bad_type_info(), }; debug_assert!((bytes.as_ptr() as usize) % (Self::ALIGN32 as usize) == 0); - // FIXME: needs memory64 treatment + // FIXME(#4311): needs memory64 treatment let ptr = u32::from_le_bytes(bytes[..4].try_into().unwrap()); let len = u32::from_le_bytes(bytes[4..].try_into().unwrap()); let (ptr, len) = (usize::try_from(ptr)?, usize::try_from(len)?); diff --git a/crates/wasmtime/src/runtime/component/values.rs b/crates/wasmtime/src/runtime/component/values.rs index 15d99847897d..5c0ed9250164 100644 --- a/crates/wasmtime/src/runtime/component/values.rs +++ b/crates/wasmtime/src/runtime/component/values.rs @@ -113,7 +113,7 @@ impl Val { } InterfaceType::String => Val::String(<_>::lift(cx, ty, &[*next(src), *next(src)])?), InterfaceType::List(i) => { - // FIXME: needs memory64 treatment + // FIXME(#4311): needs memory64 treatment let ptr = u32::lift(cx, InterfaceType::U32, next(src))? as usize; let len = u32::lift(cx, InterfaceType::U32, next(src))? as usize; load_list(cx, i, ptr, len)? @@ -221,7 +221,7 @@ impl Val { Val::Resource(ResourceAny::load(cx, ty, bytes)?) } InterfaceType::List(i) => { - // FIXME: needs memory64 treatment + // FIXME(#4311): needs memory64 treatment let ptr = u32::from_le_bytes(bytes[..4].try_into().unwrap()) as usize; let len = u32::from_le_bytes(bytes[4..].try_into().unwrap()) as usize; load_list(cx, i, ptr, len)? @@ -477,7 +477,7 @@ impl Val { (InterfaceType::List(ty), Val::List(values)) => { let ty = &cx.types[ty]; let (ptr, len) = lower_list(cx, ty.element, values)?; - // FIXME: needs memory64 handling + // FIXME(#4311): needs memory64 handling *cx.get(offset + 0) = u32::try_from(ptr).unwrap().to_le_bytes(); *cx.get(offset + 4) = u32::try_from(len).unwrap().to_le_bytes(); Ok(())