java-topology/defects/wasmtime/patch/wasmtime-0002.patch

34 lines
1.5 KiB
Diff

# UNDF: UNDF-2026-000000337
--- a/crates/environ/src/component/translate/adapt.rs
+++ b/crates/environ/src/component/translate/adapt.rs
@@ -168,7 +168,8 @@ pub struct AdapterOptions {
pub instance: RuntimeComponentInstanceIndex,
/// The ancestors (i.e. chain of instantiating instances) of the instance
/// specified in the `instance` field.
- pub ancestors: Vec<RuntimeComponentInstanceIndex>,
+ /// Stored as IndexSet for O(1) contains() — order preserved for serialization.
+ pub ancestors: indexmap::IndexSet<RuntimeComponentInstanceIndex>,
--- a/crates/environ/src/fact.rs
+++ b/crates/environ/src/fact.rs
@@ -127,7 +127,8 @@ struct AdapterOptions {
instance: RuntimeComponentInstanceIndex,
/// The ancestors (i.e. chain of instantiating instances) of the instance
/// specified in the `instance` field.
- ancestors: Vec<RuntimeComponentInstanceIndex>,
+ /// IndexSet for O(1) contains().
+ ancestors: indexmap::IndexSet<RuntimeComponentInstanceIndex>,
--- a/crates/environ/src/component/translate/inline.rs
+++ b/crates/environ/src/component/translate/inline.rs
@@ -1580,7 +1580,8 @@ fn build_adapter_options(...) -> AdapterOptions {
AdapterOptions {
instance: frame.instance,
- ancestors: frames
+ ancestors: frames
.iter()
.rev()
.skip(1)
.map(|(frame, _)| frame.instance)
- .collect(),
+ .collect::<indexmap::IndexSet<_>>(),