Skip to content

Commit

Permalink
Update the compiler for void feature according to the new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vi3tL0u1s authored and Samuel Groß committed Dec 4, 2024
1 parent 6abd952 commit d4796ed
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 414 deletions.
3 changes: 3 additions & 0 deletions Sources/Fuzzilli/Compiler/Compiler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,9 @@ public class JavaScriptCompiler {
if unaryExpression.operator == "typeof" {
let argument = try compileExpression(unaryExpression.argument)
return emit(TypeOf(), withInputs: [argument]).output
} else if unaryExpression.operator == "void" {
let argument = try compileExpression(unaryExpression.argument)
return emit(Void_(), withInputs: [argument]).output
} else if unaryExpression.operator == "delete" {
guard case .memberExpression(let memberExpression) = unaryExpression.argument.expression else {
throw CompilerError.invalidNodeError("delete operator must be applied to a member expression")
Expand Down
6 changes: 3 additions & 3 deletions Sources/Fuzzilli/Protobuf/operations.pb.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// DO NOT EDIT.
// swift-format-ignore-file
// swiftlint:disable all
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: operations.proto
Expand All @@ -21,7 +22,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import Foundation
import SwiftProtobuf

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

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

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

0 comments on commit d4796ed

Please sign in to comment.