Skip to content

flipdiff: segfault when patches don't commute #178

@ralokt

Description

@ralokt

flipdiff currently segfaults with the following inputs:

fdsf1:

diff --git a/abc.txt b/abc.txt
index c0d0fb4..5b88d3e 100644
--- a/abc.txt
+++ b/abc.txt
@@ -1,2 +1,2 @@
-a
-b
+a-m
+b-y

fdsf2:

diff --git a/abc.txt b/abc.txt
index 5b88d3e..c36071c 100644
--- a/abc.txt
+++ b/abc.txt
@@ -1,2 +1,2 @@
-a-m
+a

and the following invocation:

flipdiff --debug fdsf{1,2}

Debug output:

Auto-determined -p0
1: -1
2: 1
@1: removed (-1)
@1: removed (-1)
@1: removed (-1)
@2: 0

I should note that these patches don't commute. However, such input can come from git diff (I edited the input to make the reproduction more minimal, but I discovered it looking at patches generated by git diff).

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