fuzzilli icon indicating copy to clipboard operation
fuzzilli copied to clipboard

Compile error

Open Wa1nut4 opened this issue 11 months ago • 3 comments

environment:

Linux kali 6.5.0-kali3-amd64
swift 6.0.3

compile error as follow:

Building for debugging...
/home/kali/Fuzz/fuzzilli/Sources/Fuzzilli/Lifting/WasmLifter.swift:595:55: error: cannot call value of non-function type 'Int'
        let numDefinedTablesWithEntries = self.tables.count { instruction in
                                                      ^
error: fatalError

whether is the swift version too high?

Wa1nut4 avatar Feb 08 '25 07:02 Wa1nut4

The Array.count with a predicate function was added in 6.0.x[^1], are you sure you compiled with 6.0.3? (I ran into the same issue when the change landed and updating to 6.0.3 fixed the compile error.)

As a workround you could replace the code in question with:

 let numDefinedTablesWithEntries = self.tables.filter { instruction in
    !(instruction.op as! WasmDefineTable).definedEntryIndices.isEmpty
}.count

[^1]: Unfortunately the Swift documentation doesn't seem to document this.

Liedtke avatar Feb 08 '25 12:02 Liedtke

i meet the same question when build fuzzilli in swift 5.9

diaoqi129 avatar Feb 12 '25 06:02 diaoqi129

the build issue were fixed in Swift 6.2.1, let me check that.

shopifyjohncoulter-code avatar Nov 13 '25 12:11 shopifyjohncoulter-code