Skip to content

Commit 296ff11

Browse files
Validation: Check result types at end of root block
1 parent 82fc5ff commit 296ff11

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Sources/WasmKit/Translator.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,12 +1209,10 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
12091209
//
12101210
iseqBuilder.resetLastEmission()
12111211
if case .block(root: true) = toBePopped.kind {
1212-
if toBePopped.reachable {
1213-
try translateReturn()
1214-
// TODO: Merge logic with regular block frame
1215-
guard valueStack.height == toBePopped.stackHeight else {
1216-
throw ValidationError("values remaining on stack at end of block")
1217-
}
1212+
try translateReturn()
1213+
// TODO: Merge logic with regular block frame
1214+
guard valueStack.height == toBePopped.stackHeight else {
1215+
throw ValidationError("values remaining on stack at end of block")
12181216
}
12191217
try iseqBuilder.pinLabelHere(toBePopped.continuation)
12201218
return

0 commit comments

Comments
 (0)