We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f58ee38 commit a63410dCopy full SHA for a63410d
crates/wasmi/src/engine/translator/translator2/mod.rs
@@ -78,6 +78,15 @@ pub struct FuncTranslatorAllocations {
78
instrs: InstrEncoder,
79
}
80
81
+impl Reset for FuncTranslatorAllocations {
82
+ fn reset(&mut self) {
83
+ self.stack.reset();
84
+ self.layout.reset();
85
+ self.labels.reset();
86
+ self.instrs.reset();
87
+ }
88
+}
89
+
90
impl WasmTranslator<'_> for FuncTranslator {
91
type Allocations = FuncTranslatorAllocations;
92
@@ -137,7 +146,12 @@ impl FuncTranslator {
137
146
stack,
138
147
layout,
139
148
labels,
140
- } = alloc;
149
+ instrs,
150
+ } = {
151
+ let mut alloc = alloc;
152
+ alloc.reset();
153
+ alloc
154
+ };
141
155
Ok(Self {
142
156
func,
143
157
engine,
0 commit comments