You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[What happened]
The running code stuck and never exited
Reproduction steps
// main.rs// Running the code belowfnmain(){letmut env = minijinja::Environment::new();
env.add_template("my_test",{r#" {% for item in content.products.items() %} {{ foo.bar }} {{ item.name }} // remove this line and it will run to exit {% endfor %} "#}).unwrap();let tpl = env.get_template("my_test").unwrap();println!("check point 1");let ret = tpl.undeclared_variables(true); <-- stuck here
println!("check point 2, ret={:?}", ret); <-- never see this
}
# Cargo.toml
[package]
name = "undeclared_variables_stuck_issue"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
minijinja = "1.0.17"
If set nested param to false, it's able to run to exit
What did you expect
When running the code above, I expect to see
check point 1
check point 2, ret={"foo.bar", "content.products.items"}
# Note that the output didn't have `item.name` # cause it's a declared variable in for loop
[What you think should have happened]
The cpu is high (20 % v.s 5%) all time when running the code above, I guess it might enter an infinite cyclic loop
The text was updated successfully, but these errors were encountered:
Description
minijinja undeclared_variables() stucks when there is a variable in
for loop
[What happened]
The running code stuck and never exited
Reproduction steps
Additional helpful information:
nested
param tofalse
, it's able to run to exitWhat did you expect
When running the code above, I expect to see
[What you think should have happened]
The
cpu
is high (20 % v.s 5%) all time when running the code above, I guess it might enter an infinite cyclic loopThe text was updated successfully, but these errors were encountered: