mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Make --ftrace more crash proof with foreign code
Sometimes we need to interact with code that wasn't compiled using `-fno-omit-frame-pointer`. For example, if a function pointer gets passed and called by a foreign function, linked by cosmo_dlopen(). Function call tracing will now detect backtrace pointer corruption and simply reduce the indentation level back to zero, as a result.
This commit is contained in:
parent
38af54a2dd
commit
e9a756e78b
2 changed files with 6 additions and 1 deletions
|
@ -51,7 +51,7 @@ static struct CosmoFtrace g_ftrace;
|
|||
|
||||
__funline int GetNestingLevelImpl(struct StackFrame *frame) {
|
||||
int nesting = -2;
|
||||
while (frame) {
|
||||
while (frame && !kisdangerous(frame)) {
|
||||
++nesting;
|
||||
frame = frame->next;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue