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

fix(compiler): limit the number of chained instructions #57069

Closed
wants to merge 1 commit into from

Conversation

JoostK
Copy link
Member

@JoostK JoostK commented Jul 21, 2024

Some Angular template instructions that follow each other may be chained together in a single expressions statement, containing a deeply nested AST of call expressions. The number of chained instructions wasn't previously limited, so this could result in very deep ASTs that cause stack overflow errors during TypeScript emit.

This commit introduces a limit to the number of chained instructions to avoid these problems.

Closes #57066

@JoostK JoostK added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: compiler Issues related to `ngc`, Angular's template compiler labels Jul 21, 2024
@ngbot ngbot bot added this to the Backlog milestone Jul 21, 2024
@JoostK JoostK added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 22, 2024
Some Angular template instructions that follow each other may be chained
together in a single expressions statement, containing a deeply nested
AST of call expressions. The number of chained instructions wasn't previously
limited, so this could result in very deep ASTs that cause stack overflow
errors during TypeScript emit.

This commit introduces a limit to the number of chained instructions to
avoid these problems.

Closes angular#57066
@JoostK JoostK force-pushed the compiler/limit_chaining_depth branch from 1bfeaa7 to a5d053d Compare July 22, 2024 16:24
@angular-robot angular-robot bot requested a review from crisbeto July 22, 2024 16:24
@crisbeto
Copy link
Member

I've just kicked off a presubmit.

@atscott
Copy link
Contributor

atscott commented Jul 22, 2024

This PR was merged into the repository by commit 08c5977.

The changes were merged into the following branches: main, 18.1.x

atscott pushed a commit that referenced this pull request Jul 22, 2024
Some Angular template instructions that follow each other may be chained
together in a single expressions statement, containing a deeply nested
AST of call expressions. The number of chained instructions wasn't previously
limited, so this could result in very deep ASTs that cause stack overflow
errors during TypeScript emit.

This commit introduces a limit to the number of chained instructions to
avoid these problems.

Closes #57066

PR Close #57069
@atscott atscott closed this in 08c5977 Jul 22, 2024
vladboisa pushed a commit to vladboisa/angular that referenced this pull request Jul 29, 2024
Some Angular template instructions that follow each other may be chained
together in a single expressions statement, containing a deeply nested
AST of call expressions. The number of chained instructions wasn't previously
limited, so this could result in very deep ASTs that cause stack overflow
errors during TypeScript emit.

This commit introduces a limit to the number of chained instructions to
avoid these problems.

Closes angular#57066

PR Close angular#57069
ShahriarMalik pushed a commit to ShahriarMalik/angular that referenced this pull request Jul 30, 2024
Some Angular template instructions that follow each other may be chained
together in a single expressions statement, containing a deeply nested
AST of call expressions. The number of chained instructions wasn't previously
limited, so this could result in very deep ASTs that cause stack overflow
errors during TypeScript emit.

This commit introduces a limit to the number of chained instructions to
avoid these problems.

Closes angular#57066

PR Close angular#57069
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max Call Stack error with large template
3 participants