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 setting end-of-event false after it's true #106

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

Conversation

sfgeorge
Copy link
Contributor

Given this setter:

dtmf_frame.end_of_event = 1
dtmf_frame.end_of_event = 0

It's expected the following getter would return 0:

dtmf_frame.end_of_event
#=> 0

Actual result:

dtmf_frame.end_of_event
#=> 1

Cause

The previous un-setter is trying to negate END_OF_EVENT, but does so by subtracting 15 - 128:

@flags &= (0xf - END_OF_EVENT)

This does not produce the intended effect, and end-of-event remains set. (Additionally, side effects on other properties in @flags are also possible).

Not really a big deal

Rest assured however, this "bug" doesn't actually exhibit bad behavior in sippy_cup. Because its code never sets dtmf_frame.end_of_event more than 1 time per instance. There is no place in the code where multiple values are set for end_of_event of the same dtmf_frame instance. So this is a theoretical bug, at best.

@sfgeorge sfgeorge changed the title Fix setting end-of-event false after its true Fix setting end-of-event false after it's true Sep 11, 2019
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