# std.debug: remove \`@frameAddress\(\)\` "UAF" · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a31950aa578824e0933b49109f6ac55c84979b6d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a31950aa578824e0933b49109f6ac55c84979b6d

Requested commit: a31950aa578824e0933b49109f6ac55c84979b6d

Commit: a31950aa578824e0933b49109f6ac55c84979b6d

Tree: f704452b38410eb4ec1f1dc7139a6807c9ffc767

Author: mlugg

Committer: Matthew Lugg

## Message

```
std.debug: remove `@frameAddress()` "UAF"

We can't call `@frameAddress()` and then immediately `return`! That
invalidates the frame. This *usually* isn't a problem, because the stack
walk `next` call will *probably* have a stack frame and it will
*probably* be at the exact same address, but neither of those is a
guarantee. On powerpc, presumably some unfortunate inlining was going
on, so this frame was indeed invalidated when we started walking frames.

We need to explicitly pass `@frameAddress` into any function which will
return before we actually walk the stack. Pretty simple patch.

Resolves: #24970

```

## Parents

- [151c7dc74b97d2552637af526cf56390586386a6](https://git.cafe/gitcafe/zig/commit/151c7dc74b97d2552637af526cf56390586386a6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a31950aa578824e0933b49109f6ac55c84979b6d?format=markdown)
