Skip to content

Commit 816329e

Browse files
Danylo MocherniukV8-internal LUCI CQ
authored andcommitted
[dumpling] Support empty string parsing in oracle.
Bug: 441467877 Change-Id: I8346b2e0eba7877d86e2db1ceb35a236c4bf0545 Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9012879 Reviewed-by: Michael Achenbach <machenbach@google.com> Commit-Queue: Danylo Mocherniuk <mdanylo@google.com>
1 parent 836950b commit 816329e

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

Sources/Fuzzilli/DumplingDiffOracle/Oracle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public final class DiffOracle {
201201
}
202202

203203
while i < frameArr.endIndex && frameArr[i].starts(with: prefix) {
204-
let data = frameArr[i].dropFirst(1).split(separator: ":", maxSplits: 1)
204+
let data = frameArr[i].dropFirst(1).split(separator: ":", maxSplits: 1, omittingEmptySubsequences: false)
205205
let number = Int(data[0])!
206206
let value = String(data[1])
207207

Tests/FuzzilliTests/DiffOracleTests.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,4 +424,30 @@ final class DiffOracleTests: XCTestCase {
424424

425425
XCTAssertTrue(DiffOracle.relate(expected, with: trace))
426426
}
427+
428+
func testEmptyStringValueParsing() {
429+
let unopt = """
430+
---I
431+
b:10
432+
f:1
433+
n:0
434+
m:6
435+
r0:ValA
436+
r5:
437+
438+
"""
439+
440+
let opt = """
441+
---I
442+
b:10
443+
f:1
444+
n:0
445+
m:6
446+
r0:ValA
447+
r5:
448+
449+
"""
450+
451+
XCTAssertTrue(DiffOracle.relate(opt, with: unopt), "Should handle empty register values (e.g. 'r5:') without crashing")
452+
}
427453
}

0 commit comments

Comments
 (0)