-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
wrong return address in @panic on riscv+freestanding #22436
Comments
I think the panic is causing the compiler to compile
The Is the lack of epilogue instructions after This happens for both |
making the panic runtime conditional produces the expected stacktrace:
And the disassembly includes a function epilogue:
|
The return address stored by the Your call stack trace implementation is displaying these return addresses, whereas your intent might be to display the addresses of the instruction that caused the call, which is the previous instruction |
Zig Version
0.14.0-dev.2613+0bf44c309
Steps to Reproduce and Observed Behavior
This repo has a reproduction: https://github.com/benburkert/freestanding.zig
(requires
qemu
withqemu-system-riscv64
)The stacktrace has the anonymous panic function instead of
root.bang
because the return address is incorrect when the panic handler runs:Expected Behavior
The stacktrace should start with
root.bang
instead ofpanic__anon_8196
.The text was updated successfully, but these errors were encountered: