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

Panic on double borrow in recursive import #23

Closed
CertainLach opened this issue Oct 30, 2020 · 0 comments · Fixed by #24
Closed

Panic on double borrow in recursive import #23

CertainLach opened this issue Oct 30, 2020 · 0 comments · Fixed by #24
Assignees
Labels
bug Something isn't working
Milestone

Comments

@CertainLach
Copy link
Owner

Jrsonnet panics while evaluating file importing itself (Instead of throwing stackoverflow):

// a.jsonnet
import 'a.jsonnet'
@CertainLach CertainLach added the bug Something isn't working label Oct 30, 2020
@CertainLach CertainLach added this to the v0.3.2 milestone Oct 30, 2020
@CertainLach CertainLach self-assigned this Oct 30, 2020
CertainLach added a commit that referenced this issue Oct 30, 2020
Signed-off-by: Yaroslav Bolyukin <[email protected]>
julienduchesne added a commit to julienduchesne/jrsonnet that referenced this issue Aug 2, 2023
I have jsonnet code ressembling the `assert_recursion_allowed.jsonnet` file
This file evaluates fine in C jsonnet and go jsonnet but fails here because of `infinite recursion detected`

The fix I propose here is to now fail when recursion is detected but rather keep going until stack overflow is reached (as is done in other jsonnet interpreters)
I also modified the test for issue CertainLach#23. This issue is still fixed IMO because it doesn't panic. Instead, it prints out the full stack, which is what other jsonnet interpreters do, and it is a meaningful error message as well

Note: I am a complete Rust noob. My fix may be terrible. Let me know if it is!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant