Skip to content

Stack traces don't contain source lines from codegen/llvm.zig #12665

@Vexu

Description

@Vexu

To reproduce:

  1. add if (true) unreachable; somewhere in codegen/llvm.zig, airArg is a good place
  2. build stage3 using stage3
  3. try to compile something so that that unreachable is hit

Stack trace:

thread 908378 panic: reached unreachable code
codegen/llvm.zig:7425:19: 0x1200f12 in airArg (zig)
codegen/llvm.zig:4201:51: 0xf676af in genBody (zig)
codegen/llvm.zig:1031:35: 0xf63157 in updateFunc (zig)
link/Elf.zig:2397:74: 0xf6b292 in updateFunc (zig)
/src/link.zig:518:77: 0xd9fcf6 in updateFunc (zig)
            .elf   => return @fieldParentPtr(Elf,   "base", base).updateFunc(module, func, air, liveness),
                                                                            ^
/src/Module.zig:4282:37: 0xb9e9c8 in ensureFuncBodyAnalyzed (zig)
            comp.bin_file.updateFunc(mod, func, air, liveness) catch |err| switch (err) {
                                    ^
/src/Compilation.zig:2976:42: 0xb9caa2 in processOneJob (zig)
            module.ensureFuncBodyAnalyzed(func) catch |err| switch (err) {
                                         ^
/src/Compilation.zig:2914:30: 0xa9219e in performAllTheWork (zig)
            try processOneJob(comp, work_item);
                             ^
/src/Compilation.zig:2255:31: 0xa8ea95 in update (zig)
    try comp.performAllTheWork(main_progress_node);
                              ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions