Skip to content

Commit c523132

Browse files
LiedtkeV8-internal LUCI CQ
authored andcommitted
[js] Fix order of reassignment logic
Mostly just to match the naming of `newValue` and the subtyping idea of the forUseAs where we try to find something that is a subtype of the current variable's type, not the other way around. Change-Id: I3144025a0e1850892936087fdf275d318943f963 Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9159757 Reviewed-by: Marja Hölttä <marja@chromium.org> Commit-Queue: Matthias Liedtke <mliedtke@google.com> Auto-Submit: Matthias Liedtke <mliedtke@google.com>
1 parent e270121 commit c523132

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Fuzzilli/CodeGen/CodeGenerators.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,7 @@ public let CodeGenerators: [CodeGenerator] = [
21042104
CodeGenerator("UpdateGenerator", inputs: .one) { b, v in
21052105
let newValue = b.randomVariable(forUseAs: b.type(of: v))
21062106
b.reassign(
2107-
variable: newValue, value: v, with: chooseUniform(from: BinaryOperator.allCases))
2107+
variable: v, value: newValue, with: chooseUniform(from: BinaryOperator.allCases))
21082108
},
21092109

21102110
CodeGenerator("DupGenerator") { b in
@@ -2114,7 +2114,7 @@ public let CodeGenerators: [CodeGenerator] = [
21142114
CodeGenerator("ReassignmentGenerator", inputs: .one) { b, v in
21152115
let newValue = b.randomVariable(forUseAs: b.type(of: v))
21162116
guard newValue != v else { return }
2117-
b.reassign(variable: newValue, value: v)
2117+
b.reassign(variable: v, value: newValue)
21182118
},
21192119

21202120
CodeGenerator("DestructArrayGenerator", inputs: .preferred(.iterable)) {

0 commit comments

Comments
 (0)