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

Critical bug causing complete crash #18

Closed
ludekvodicka opened this issue Feb 24, 2018 · 3 comments
Closed

Critical bug causing complete crash #18

ludekvodicka opened this issue Feb 24, 2018 · 3 comments
Labels

Comments

@ludekvodicka
Copy link
Contributor

ludekvodicka commented Feb 24, 2018

Hi,

I just found very strange bug which I'm not able to fix.

With this template application halted on invalid pointers and a lot of asserts.

{% if 1 >= 18 %}…{% endif %}
{% for v in vals %}
  {% if v > 0%}+{%else%}-{%endif%}
{% endfor %}

Here is test snippet:

nlohmann::json data;
data["vals"] = { "1","2" };
InjaStringType res = inja::render("{% if 1 >= 18 %}…{% endif %}{% for v in vals %}{% if v > 0%}+{%else%}-{%endif%}{% endfor %}", data);

Error:

Debug Assertion Failed!

Program: C:\WINDOWS\SYSTEM32\MSVCP140D.dll
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xutility
Line: 1115

Expression: invalid null pointer

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
@pantor pantor added the bug label Feb 28, 2018
@pantor
Copy link
Owner

pantor commented Feb 28, 2018

While your snippet does not crash on my system, there was indeed a parser bug. I've fixed the bug in the latest commit and hope that it also fixes the crashing.

@ludekvodicka
Copy link
Contributor Author

Ok, I will try it again with latest release and let you know

@ludekvodicka
Copy link
Contributor Author

I can confirm that last changes fixed this bug. Thanks

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

No branches or pull requests

2 participants