Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gregs usage on 32-bit powerpc (#8)
The old code was wrong as `uc_regs` is not a registers array, but rather an `mcontext_t` pointer on glibc, therefore indexing it goes way past the memory bounds. The actual registers array is `gregs` inside the `mcontext_t` structure. On non-glibc libcs (as well as inside the kernel definitions), the structure is defined differently, with `uc_mcontext` being an actual value member just like on ppc64, so we can use that. On glibc/ppc32, `mcontext_t` is an union of `uc_regs` and `regs` pointers, with the value of the member being a pointer to where the real `uc_mcontext` field would be.
- Loading branch information