diff options
| author | Xavier Bouchoux <xavierb@gmail.com> | 2022-10-15 16:58:29 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-10-18 13:03:22 +0200 |
| commit | 23e212a9d0b5cfdff991a40ca264f9d1284f0d5f (patch) | |
| tree | e53a70f813fb78130c7b5dfc08cef27f3b794aaf /src/codegen/llvm.zig | |
| parent | bd0dd225e843801b4b6162cbd2709c7325ab87b7 (diff) | |
| download | zig-23e212a9d0b5cfdff991a40ca264f9d1284f0d5f.tar.gz zig-23e212a9d0b5cfdff991a40ca264f9d1284f0d5f.zip | |
std: check for overflow in dumpStackTraceFromBase
same change as [68e26a2ceea85a1] "std: check for overflow in writeCurrentStackTrace"
On arm64 macOS, the address of the last frame is 0x0 rather than
a positive value like 0x1 on x86_64 macOS, therefore, we overflow
an integer trying to subtract 1 when printing the stack trace. This
patch fixes it by first checking for this condition before trying
to subtract 1.
Same behaviour on i386-windows-msvc.
Note that we do not need to signal the `SignalIterator` about this
as it will correctly detect this condition on the subsequent iteration
and return `null`, thus terminating the loop.
Diffstat (limited to 'src/codegen/llvm.zig')
0 files changed, 0 insertions, 0 deletions
