Skip to content

Merge fails for large files #2

@michael-bieniosek

Description

@michael-bieniosek

I was testing merging on a very large file (260k lines) and hit a panic here: https://github.com/nasdf/diff3/blob/main/diff3.go#L131

panic: runtime error: index out of range [157894] with length 155846

After a bit of inspection, I think the issue is that you're calling int(r) instead of diffmatchpatch.runeToInt(r), as DiffCharsToLines does it. From looking at code for runeToInt/intToRune it seems like this could happen with much smaller file size than 100k+ lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions