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

After updating to version 0.156.0 I got exception if querying empty string #270

Closed
1 of 3 tasks
wenwenchenbosch opened this issue Sep 15, 2020 · 2 comments
Closed
1 of 3 tasks

Comments

@wenwenchenbosch
Copy link

I used before jsoncons 1.105.0 and the following code works:
jsoncons::json pathRes = jsonpath::json_query(json_tree, "", jsonpath::result_type::path);
as result, pathRes.size() is equal to 0.

After I update the version to 0.156.0. I got the following assert by running the code:

ERROR: Fatal runtime error: assertion 'state_stack_.size() == 2' failed at  <> :0

Is it a bug or feature?

Enumerate the steps to reproduce the bug

  • compile the code above
  • run it

Include a small, self-contained example if possible

What compiler, architecture, and operating system?

  • Compiler: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
  • Architecture (e.g. x86, x64) x64
  • Operating system: Ubuntu

What jsoncons library version?

  • Latest release v0.156.0
  • Other release ______
  • master
@danielaparker
Copy link
Owner

danielaparker commented Sep 15, 2020

Thanks for reporting this, you're right, pathRes should return an empty array for this case.

danielaparker added a commit that referenced this issue Sep 16, 2020
danielaparker added a commit that referenced this issue Sep 17, 2020
@danielaparker
Copy link
Owner

Fixed in patch release 0.156.1, and on master.

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

No branches or pull requests

2 participants