# riscv: correctly index struct field access · gitcafe/zig

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

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

Visibility: public

Requested revision: c96989aa4b283c5d386c5f19e2b12a6b13dd521a

Requested commit: c96989aa4b283c5d386c5f19e2b12a6b13dd521a

Commit: c96989aa4b283c5d386c5f19e2b12a6b13dd521a

Tree: 5febf790a416e5168cb9d0a08c6a2c6360b59528

Author: David Rubin

Committer: David Rubin

## Message

```
riscv: correctly index struct field access

when the struct is in stack memory, we access it using a byte-offset,
because that's how the stack works. on the other hand when the struct
is in a register, we are working with bits and the field offset should
be a bit offset.

```

## Parents

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

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