[sanitizer] Fix build.

llvm-svn: 201152
This commit is contained in:
Evgeniy Stepanov 2014-02-11 13:45:01 +00:00
parent 769d46f373
commit 2629e575db
3 changed files with 15 additions and 15 deletions

View File

@ -34,19 +34,19 @@ int pthread_key_create(unsigned *key, void (*destructor)(void* v));
int pthread_setspecific(unsigned key, const void *v);
}
#define GET_STACK_TRACE \
StackTrace stack; \
{ \
uptr stack_top = 0, stack_bottom = 0; \
ThreadContext *t; \
bool fast = common_flags()->fast_unwind_on_malloc; \
if (fast && (t = CurrentThreadContext())) { \
stack_top = t->stack_end(); \
stack_bottom = t->stack_begin(); \
} \
stack.Unwind(__sanitizer::common_flags()->malloc_context_size, \
StackTrace::GetCurrentPc(), \
GET_CURRENT_FRAME(), stack_top, stack_bottom, fast); \
#define GET_STACK_TRACE \
StackTrace stack; \
{ \
uptr stack_top = 0, stack_bottom = 0; \
ThreadContext *t; \
bool fast = common_flags()->fast_unwind_on_malloc; \
if (fast && (t = CurrentThreadContext())) { \
stack_top = t->stack_end(); \
stack_bottom = t->stack_begin(); \
} \
stack.Unwind(__sanitizer::common_flags()->malloc_context_size, \
StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), 0, \
stack_top, stack_bottom, fast); \
}
#define ENSURE_LSAN_INITED do { \

View File

@ -71,7 +71,7 @@ void StackTrace::Unwind(uptr max_depth, uptr pc, uptr bp, void *context,
SlowUnwindStackWithContext(pc, context, max_depth);
else
SlowUnwindStack(pc, max_depth);
} else {
} else {
FastUnwindStack(pc, bp, stack_top, stack_bottom, max_depth);
}

View File

@ -23,7 +23,7 @@ class FastUnwindTest : public ::testing::Test {
bool TryFastUnwind(uptr max_depth) {
if (!StackTrace::WillUseFastUnwind(true))
return false;
trace.Unwind(max_depth, start_pc, (uptr)&fake_stack[0], fake_top,
trace.Unwind(max_depth, start_pc, (uptr)&fake_stack[0], 0, fake_top,
fake_bottom, true);
return true;
}