Skip to content

Commit f671b64

Browse files
carl-smithV8-internal LUCI CQ
authored andcommitted
Relax some assertions in importAnalysis
WasmBeginCatch and WasmThrow would assert that the input matches with the type in the instruction in the importAnalysis. This can fail if mutations change those. With this change we will now throw a missingTypeInformation exception instead of crashing. Change-Id: I1f4cfbab67fcc54629a614643b39a898505c126d Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/7977728 Reviewed-by: Matthias Liedtke <[email protected]> Commit-Queue: Carl Smith <[email protected]>
1 parent f056ee5 commit f671b64

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/Fuzzilli/Lifting/WasmLifter.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,10 +1092,16 @@ public class WasmLifter {
10921092
self.tags[instr.output] = op.parameters
10931093

10941094
case .wasmBeginCatch(let op):
1095+
if !typer.type(of: instr.input(0)).isWasmTagType {
1096+
throw WasmLifter.CompileError.missingTypeInformation
1097+
}
10951098
assert(typer.type(of: instr.input(0)).wasmTagType!.parameters == op.signature.parameters)
10961099
importTagIfNeeded(tag: instr.input(0), parameters: op.signature.parameters)
10971100

10981101
case .wasmThrow(let op):
1102+
if !typer.type(of: instr.input(0)).isWasmTagType {
1103+
throw WasmLifter.CompileError.missingTypeInformation
1104+
}
10991105
assert(typer.type(of: instr.input(0)).wasmTagType!.parameters == op.parameters)
11001106
importTagIfNeeded(tag: instr.input(0), parameters: op.parameters)
11011107

0 commit comments

Comments
 (0)