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

json: Fix a disjointed update of a token's pointer and length in json_deq() #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

igorburago
Copy link

@igorburago igorburago commented Sep 22, 2023

Fix an obvious typo: In a clear contradiction with the intent, in the paired update of the token pointer and length fields in json_deq(), it is only the former that is guarded by the if statement.

To make sure that this is the only occurrence of this bug, I inspected all other places in json.h where a similar joint update happens on a single line, and propose to also consistently use single statements for all of them (like it is already done on line 985 here and in many places in sdefl.h and sinfl.h, for example).

…tements

When a pointer-index pair is jointly updated on a single line, it is
sometimes kept as two separate statements and sometimes melded into
one. Since the whole point of making said updates one-liners is to
highlight their paired nature, let us make it clear in a consistent
way and always use a single statement in such cases.
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