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: parameter variable infinite recursion error #5500

Merged
merged 2 commits into from Apr 29, 2024

Conversation

liuly0322
Copy link
Contributor

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

The function parameter will only get a known value when it is the callee of a function call. It is also where the hasEffects of function body gets called (and the only place?), we need to make sure the known value is set first, then hasEffects of function body gets called for NewExpression and TaggedTemplateExpression too. In that case, we can get exactly a "call tree" instead of a "call graph", so the known value of a parameter is guaranteed to come from somewhere outside the function and is guaranteed to from a "analyzed" code/function.

Ensure before hasEffects of function body (triggered by function call), the arguments are first provided
Copy link

vercel bot commented Apr 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 29, 2024 3:42am

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.81%. Comparing base (9135249) to head (9f294ef).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5500      +/-   ##
==========================================
- Coverage   98.81%   98.81%   -0.01%     
==========================================
  Files         238      238              
  Lines        9540     9538       -2     
  Branches     2436     2436              
==========================================
- Hits         9427     9425       -2     
  Misses         48       48              
  Partials       65       65              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks for the quick fix. Yes, NewExpression and TaggedTemplateExpression should be the only other places where we call a variable. There is some additional call deoptimization logic in knownGlobals.ts, but I think that should be non-critical.

@lukastaegert lukastaegert merged commit 571929f into rollup:master Apr 29, 2024
38 of 39 checks passed
Copy link

This PR has been released as part of rollup@4.17.1. You can test it via npm install rollup.

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

Successfully merging this pull request may close these issues.

Upgrade from vite 4 to vite 5 crashes in rollup with maximum call stack exceeded
2 participants