mirror of
https://github.com/tailix/libkernaux.git
synced 2024-10-30 11:54:01 -04:00
Fix bug
This commit is contained in:
parent
025667f1d4
commit
eae451ee75
2 changed files with 5 additions and 2 deletions
|
@ -22,11 +22,13 @@ struct KernAux_StackTrace_Frame KernAux_StackTrace_Frame_create()
|
|||
struct KernAux_StackTrace_Frame frame = { .cur_ptr = NULL };
|
||||
|
||||
#if defined(ASM_I386)
|
||||
const size_t *cur_ptr = frame.cur_ptr;
|
||||
const size_t *cur_ptr;
|
||||
KERNAUX_ASM("movl %%ebp, %0" : "=g" (cur_ptr) :: "memory");
|
||||
frame.cur_ptr = cur_ptr;
|
||||
#elif defined(ASM_X86_64)
|
||||
const size_t *cur_ptr = frame.cur_ptr;
|
||||
const size_t *cur_ptr;
|
||||
KERNAUX_ASM("movq %%rbp, %0" : "=g" (cur_ptr) :: "memory");
|
||||
frame.cur_ptr = cur_ptr;
|
||||
#endif
|
||||
|
||||
return frame;
|
||||
|
|
|
@ -39,6 +39,7 @@ static const void *max_addresses[MAX_SIZE];
|
|||
++lower##_count; \
|
||||
} \
|
||||
\
|
||||
assert(lower##_count >= 2); \
|
||||
putchar('\n'); \
|
||||
} while (0)
|
||||
|
||||
|
|
Loading…
Reference in a new issue