mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-11 02:16:50 +00:00
[ASan] Fix StackTrace::SlowUnwindStack on Windows
llvm-svn: 196894
This commit is contained in:
parent
8e6afd4785
commit
89a346c2a1
@ -148,7 +148,7 @@ static bool MatchPc(uptr cur_pc, uptr trace_pc, uptr threshold) {
|
||||
}
|
||||
|
||||
void StackTrace::PopStackFrames(uptr count) {
|
||||
CHECK(count < size);
|
||||
CHECK_LT(count, size);
|
||||
size -= count;
|
||||
for (uptr i = 0; i < size; ++i) {
|
||||
trace[i] = trace[i + count];
|
||||
|
@ -382,6 +382,9 @@ void StackTrace::SlowUnwindStack(uptr pc, uptr max_depth) {
|
||||
// FIXME: Look at LLVMUnhandledExceptionFilter in Signals.inc
|
||||
size = CaptureStackBackTrace(2, Min(max_depth, kStackTraceMax),
|
||||
(void**)trace, 0);
|
||||
if (size == 0)
|
||||
return;
|
||||
|
||||
// Skip the RTL frames by searching for the PC in the stacktrace.
|
||||
uptr pc_location = LocatePcInTrace(pc);
|
||||
PopStackFrames(pc_location);
|
||||
|
Loading…
x
Reference in New Issue
Block a user