json: Fix a disjointed update of a token's pointer and length in json_deq()#46
Open
igorburago wants to merge 2 commits intovurtun:masterfrom
Open
json: Fix a disjointed update of a token's pointer and length in json_deq()#46igorburago wants to merge 2 commits intovurtun:masterfrom
igorburago wants to merge 2 commits intovurtun:masterfrom
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).