Skip to content

Core._apply emits bad code #39113

@simeonschaub

Description

@simeonschaub

The following fails on 1.6 and latest master:

julia> f(x) = Core._apply(-, x)
f (generic function with 1 method)

julia> f(1)
ERROR: BoundsError: attempt to access Nothing at index [1]
Stacktrace:
 [1] f(x::Int64)
   @ Main ./REPL[1]:1
 [2] top-level scope
   @ REPL[2]:1

Note that this work if it's at the toplevel, so it seems to happen somewhere during optimization:

julia> Core._apply(-, 1)
-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:optimizerOptimization passes (mostly in base/compiler/ssair/)regressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions