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

@errorName not working on selfhosted x86-64 backend #22362

Open
AndrewKraevskii opened this issue Dec 30, 2024 · 0 comments
Open

@errorName not working on selfhosted x86-64 backend #22362

AndrewKraevskii opened this issue Dec 30, 2024 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@AndrewKraevskii
Copy link
Contributor

Zig Version

0.14.0-dev.2577+271452d22

Steps to Reproduce and Observed Behavior

Compile this program on linux x86-64:

const std = @import("std");

pub fn main() !void {
    foo() catch |e| {
        const str = @errorName(e);
        std.debug.print("{s}\n", .{str});
    };
}

fn foo() !void {
    return error.OutOfMemory;
}

running selfhosted

zig run main.zig -fno-llvm -fno-lld

gives


fMemory

and running llvm backend gives

zig run main.zig
OutOfMemory

On 0.13.0 it works correctly so its regression

Expected Behavior

I expect output of first and second run to be the same (e.g. "OutOfMemory")

@AndrewKraevskii AndrewKraevskii added the bug Observed behavior contradicts documented or intended behavior label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant