googleprojectzero / googleprojectzero/fuzzilli

may remove this assert

Open
#424 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.3k
Forks
367
Avg merge
23h 53m
Merged PRs (30d)
1

Description

    /// Emit one line of code.
    mutating func emit<S: StringProtocol>(_ line: S) {
        assert(!line.contains("\n"))       // <--------- 
        currentLineNumber += 1
        if includeLineNumbers { code += "\(String(format: "%3i", currentLineNumber)). " }
        code += currentIndention + line + "\n"
    }

sometimes, TemplateLiteral expression may contains multiples line, that assert seems not to must.

https://github.com/googleprojectzero/fuzzilli/blob/main/Sources/Fuzzilli/Lifting/ScriptWriter.swift#L44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Sources/Fuzzilli/Lifting/ScriptWriter.swift at the emit function and its assertion on line contents. Trace how multiline TemplateLiteral expressions reach this function, then verify that valid multiline expressions are handled without the assertion while normal line emission remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.