Skip to content

Commit d4796ed

Browse files
vi3tL0u1sSamuel Groß
authored andcommitted
Update the compiler for void feature according to the new changes
1 parent 6abd952 commit d4796ed

File tree

6 files changed

+428
-414
lines changed

6 files changed

+428
-414
lines changed

Sources/Fuzzilli/Compiler/Compiler.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,9 @@ public class JavaScriptCompiler {
10591059
if unaryExpression.operator == "typeof" {
10601060
let argument = try compileExpression(unaryExpression.argument)
10611061
return emit(TypeOf(), withInputs: [argument]).output
1062+
} else if unaryExpression.operator == "void" {
1063+
let argument = try compileExpression(unaryExpression.argument)
1064+
return emit(Void_(), withInputs: [argument]).output
10621065
} else if unaryExpression.operator == "delete" {
10631066
guard case .memberExpression(let memberExpression) = unaryExpression.argument.expression else {
10641067
throw CompilerError.invalidNodeError("delete operator must be applied to a member expression")

Sources/Fuzzilli/Protobuf/operations.pb.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// DO NOT EDIT.
22
// swift-format-ignore-file
3+
// swiftlint:disable all
34
//
45
// Generated by the Swift generator plugin for the protocol buffer compiler.
56
// Source: operations.proto
@@ -21,7 +22,6 @@
2122
// See the License for the specific language governing permissions and
2223
// limitations under the License.
2324

24-
import Foundation
2525
import SwiftProtobuf
2626

2727
// If the compiler emits an error on this type, it is because this file
@@ -4900,8 +4900,8 @@ extension Fuzzilli_Protobuf_Void: SwiftProtobuf.Message, SwiftProtobuf._MessageI
49004900
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()
49014901

49024902
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
4903-
while let _ = try decoder.nextFieldNumber() {
4904-
}
4903+
// Load everything into unknown fields
4904+
while try decoder.nextFieldNumber() != nil {}
49054905
}
49064906

49074907
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {

0 commit comments

Comments
 (0)