Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Adjust stacktrace to point at CALL instruction instead of return address
Browse files Browse the repository at this point in the history
  • Loading branch information
yazd committed Aug 31, 2015
1 parent 44e41db commit 8822115
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/runtime.d
Expand Up @@ -492,7 +492,9 @@ Throwable.TraceInfo defaultTraceHandler( void* ptr = null )
stackPtr < stackBottom &&
numframes < MAXFRAMES; )
{
callstack[numframes++] = *(stackPtr + 1);
enum CALL_INSTRUCTION_SIZE = 1; // it may not be 1 but it is good enough to get
// in CALL instruction address range for backtrace
callstack[numframes++] = *(stackPtr + 1) - CALL_INSTRUCTION_SIZE;
stackPtr = cast(void**) *stackPtr;
}
}
Expand Down

0 comments on commit 8822115

Please sign in to comment.