Skip to content

Commit 6298076

Browse files
mi-acV8-internal LUCI CQ
authored andcommitted
[clean-up] Properly reset the program builder
Bug: 465497343 Change-Id: I37625a7b5dc60ea9fc60efb083b36a8b92720588 Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9028516 Commit-Queue: Michael Achenbach <machenbach@google.com> Reviewed-by: Matthias Liedtke <mliedtke@google.com>
1 parent 7235a53 commit 6298076

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

Sources/Fuzzilli/Base/ProgramBuilder.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ public class ProgramBuilder {
144144
// Runtime data that can be shared between different stubs within a CodeGenerator.
145145
var runtimeData = GeneratorRuntimeData()
146146

147+
///
148+
/// Adoption of variables from a different program.
149+
/// Required when copying instructions between programs.
150+
///
151+
private var varMaps = [VariableMap<Variable>]()
152+
147153
/// Stack of active switch blocks.
148154
private var activeSwitchBlocks = Stack<SwitchBlock>()
149155

@@ -210,8 +216,13 @@ public class ProgramBuilder {
210216
jsTyper.reset()
211217
activeObjectLiterals.removeAll()
212218
activeClassDefinitions.removeAll()
219+
activeSwitchBlocks.removeAll()
220+
activeWasmModule = nil
221+
argumentGenerationSignature.removeAll()
222+
argumentGenerationVariableBudget.removeAll()
213223
buildLog?.reset()
214224
runtimeData.reset()
225+
varMaps.removeAll()
215226
}
216227

217228
/// Finalizes and returns the constructed program, then resets this builder so it can be reused for building another program.
@@ -1395,12 +1406,6 @@ public class ProgramBuilder {
13951406
return argumentTypes
13961407
}
13971408

1398-
///
1399-
/// Adoption of variables from a different program.
1400-
/// Required when copying instructions between programs.
1401-
///
1402-
private var varMaps = [VariableMap<Variable>]()
1403-
14041409
/// Prepare for adoption of variables from another program.
14051410
///
14061411
/// This sets up a mapping for variables from another program to the

0 commit comments

Comments
 (0)