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

Fix crash in banded_ssw #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix crash in banded_ssw #1

wants to merge 1 commit into from

Conversation

corwinjoy
Copy link
Owner

The loop for banded_sw sometimes cannot achieve the maximum score so it just keeps doubling the bandwidth size indefinitely until the program crashes. I'm not sure what the best fix is here but I simply bounded the loop as follows:
The original loop in banded_sw looks like
do {
..
} while (LIKELY(max < score);

I changed this to
do {
} while (LIKELY(max < score) && LIKELY(band_width <= readLen));

As I understand it, band_width > readLen doesn't make sense anyway so I think this is a reasonable fix.

The loop for banded_sw sometimes cannot achieve the maximum score so it just keeps doubling the bandwidth size indefinitely until the program crashes.  I'm not sure what the best fix is here but I simply bounded the loop as follows:
The original loop in banded_sw looks like
do {
..
} while (LIKELY(max < score);

I changed this to 
do {
} while (LIKELY(max < score) && LIKELY(band_width <= readLen));

As I understand it, band_width > readLen doesn't make sense anyway so I think this is a reasonable fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant