Skip to content

Commit 264a526

Browse files
committed
Tidy up
1 parent d2cdfbd commit 264a526

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

Sources/WasmKit/Execution/Instructions/Misc.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ extension Execution {
2121
extension Execution {
2222
mutating func refNull(sp: Sp, immediate: Instruction.RefNullOperand) {
2323
let value: Value
24-
switch immediate.type {
24+
switch immediate.type.heapType {
2525
case .externRef:
2626
value = .ref(.extern(nil))
2727
case .funcRef:
2828
value = .ref(.function(nil))
29-
default:
30-
fatalError()
3129
}
3230
sp[immediate.result] = UntypedValue(value)
3331
}

Sources/WasmKit/Execution/UntypedValue.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,11 @@ struct UntypedValue: Equatable, Hashable {
114114
guard storage & Self.isNullMaskPattern == 0 else { return nil }
115115
return Int(storage)
116116
}
117-
switch type {
117+
switch type.heapType {
118118
case .funcRef:
119119
return .function(decodeOptionalInt())
120120
case .externRef:
121121
return .extern(decodeOptionalInt())
122-
default:
123-
fatalError()
124122
}
125123
}
126124

Sources/WasmKit/Validator.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,6 @@ struct ModuleValidator {
333333
extension WasmTypes.Reference {
334334
/// Checks if the reference type matches the expected type.
335335
func checkType(_ type: WasmTypes.ReferenceType) throws {
336-
337-
// Should we validate nonNull variants have associated values present?
338336
switch (self, type) {
339337
case (.function, .funcRef): return
340338
case (.extern, .externRef): return

0 commit comments

Comments
 (0)