Skip to content

Conversation

@mlechu
Copy link
Member

@mlechu mlechu commented Feb 20, 2025

Fixes #51572. The expander had a looser definition of a vararg than the recursive logic destructing the vararg, so a bad expression like (call f (... x y)) could cause a stack overflow via indestructible mutant semi-vararg.

This change produces a saner error in this situation:

julia> macro foo(); Expr(:(...), 1, 2, 3); end; (@foo,)
ERROR: syntax: wrong number of expressions following "..." around REPL[1]:1
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

@mlechu mlechu added compiler:lowering Syntax lowering (compiler front end, 2nd stage) bugfix This change fixes an existing bug labels Feb 20, 2025
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Feb 20, 2025
@giordano giordano merged commit 3c02af9 into JuliaLang:master Feb 21, 2025
8 checks passed
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stackoverflow while attempting to show error due to malformed :(...) syntax

4 participants