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

Setup path correctly after stream parsing a key:value object pair #2642

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

wader
Copy link
Member

@wader wader commented Jun 30, 2023

Fixes #2378 (assert on parsing invalid object)

@wader
Copy link
Member Author

wader commented Jun 30, 2023

@itchyny do you think that make sense? can't claim i understand the parsing code yet

BTW do you have any 1.7 labeled issues you want help with? i've picked at few a random to look at

@wader wader force-pushed the stream-parse-invalid-pair-assert branch 4 times, most recently from a99a764 to 38f122d Compare June 30, 2023 21:47
@itchyny itchyny added the bug label Jul 1, 2023
@itchyny itchyny added this to the 1.7 release milestone Jul 1, 2023
@itchyny
Copy link
Contributor

itchyny commented Jul 2, 2023

I'll take a look at this (please forgive me for a few days).

@wader
Copy link
Member Author

wader commented Jul 3, 2023

@itchyny no worries

Copy link
Contributor

@itchyny itchyny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

src/jv_parse.c Outdated
@@ -299,7 +299,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
p->output = JV_ARRAY(jv_copy(p->path), p->next);
p->next = jv_invalid();
}
p->path = jv_array_set(p->path, p->stacklen - 1, jv_true()); // ready for another name:value pair
p->path = jv_array_set(p->path, p->stacklen - 1, jv_null()); // ready for another name:value pair
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the comment, key:value pair is better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap updated and it seems to be to only place in the code where "name:value" was used

@wader wader force-pushed the stream-parse-invalid-pair-assert branch from 38f122d to 8c9dd2b Compare July 4, 2023 14:53
@wader wader force-pushed the stream-parse-invalid-pair-assert branch from 8c9dd2b to f3b578c Compare July 4, 2023 14:57
@wader wader changed the title Setup path correctly after stream parsing a name:value object pair Setup path correctly after stream parsing a key:value object pair Jul 4, 2023
@wader
Copy link
Member Author

wader commented Jul 4, 2023

Rebased and changed to key:value

@wader
Copy link
Member Author

wader commented Jul 4, 2023

@itchyny I noticed that "CI / dist" seems to run for PR:s, is missing if: startsWith(github.event.ref, 'refs/tags/jq-'). I wonder if there is some way to restructure the workflows so we don't need if:s and can relay on on instead?

@wader wader requested a review from itchyny July 4, 2023 16:26
@wader
Copy link
Member Author

wader commented Jul 4, 2023

Merge? Sorry dont have merge access

@itchyny
Copy link
Contributor

itchyny commented Jul 4, 2023

I'll merge this, thank you. Yeah, I'll skip the dist job in #2652.

@itchyny itchyny merged commit dfd440f into jqlang:master Jul 4, 2023
@wader
Copy link
Member Author

wader commented Jul 4, 2023

👍

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

Successfully merging this pull request may close these issues.

jq: src/jv_parse.c:305: stream_token: Assertion `k == JV_KIND_NULL' failed.
2 participants