Protect from segfault

This commit is contained in:
Alex Kotov 2022-12-04 01:26:58 +04:00
parent eae451ee75
commit 1395896538
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,8 @@ const void *KernAux_StackTrace_Frame_get_ptr(
) {
KERNAUX_ASSERT(frame);
if (!frame->cur_ptr) return NULL;
#if defined(ASM_X86)
const size_t *const cur_ptr = frame->cur_ptr;
return (const void*)cur_ptr[1];