Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error in C++ code #35

Closed
GoogleCodeExporter opened this issue Apr 12, 2016 · 2 comments
Closed

An error in C++ code #35

GoogleCodeExporter opened this issue Apr 12, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

There is an error in diff_match_patch.cpp on line 438:

436      if (!front) {
437        int k1 = delta - k2;
438        if (v2.contains(k2)) {
439          int x1 = v1.value(k1);

It should have been the following:

438        if (v1.contains(k1)) {

Original issue reported on code.google.com by snhere@gmail.com on 12 Jan 2011 at 1:25

@GoogleCodeExporter
Copy link
Author

This bug went away in today's upload since all these lines were rewritten.  
I've confirmed that this error is not in the new versions of any of the 
language ports.

However I'm not closing this bug.  At issue is that none of the unit tests 
detected this.  That's not acceptable.

Thanks for catching this.  The latest version on Subversion is fixed.  It's 
also much faster.

Original comment by neil.fra...@gmail.com on 13 Jan 2011 at 1:37

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

It turns out that the recent data structure change to v1/v2 makes this earlier 
error detectable by the existing unit tests.  When the error is recreated in 
the current code an out of range error is triggered.  Previously the hash was 
more forgiving.

Thus even if the error hadn't been inadvertently fixed in the previous upgrade, 
it would have been detected by the unit tests.

Closing.  No action needed.  Thanks for reporting this!

Original comment by neil.fra...@gmail.com on 13 Jan 2011 at 2:13

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant