-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Qute: fix possible stack overflow error in InsertSectionHelper #41517
Conversation
mkouba
commented
Jun 27, 2024
- fixes Qute: StackOverflowError due to nested #include and #insert directives #41451
@gbourant @ia3andy UPDATE: I think I found a way to mitigate the perf impact. I will update the PR tomorrow. |
@mkouba, I don't know if this is possible but at build time you might be able to give a random name to the insert directive and wrap the content of other templates to that named directive. (maybe it should be enabled via config?) For example the following templates:
<html>
<body>{#insert /}</body>
</html>
{#include auth.html}
<form>Login Form</form>
{/include} become:
<html>
<body>{#insert someRandomName /}</body>
</html>
{#include auth.html}
{#someRandomName}
<form>Login Form</form>
{/}
{/include} |
The problem is we have the same problem if those nested includes use the same explicit block name, i.e. |
I just tried it and it works buddy! :) |
What exactly? The fix in this PR? ;-) |
Yeah the fix in this PR. It doesn't throw OverflowError when using nested {#insert /} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!!
@mkouba maybe we should backport this furtther? |
Yes, it's already labeled with |
@mkouba triage backport is just for 3.12, but we should backport it to as far as it's compatible no? |