[asan] two more bits for __sparc__

llvm-svn: 169141
This commit is contained in:
Kostya Serebryany 2012-12-03 18:39:21 +00:00
parent f74c4034dd
commit 214b715061
2 changed files with 5 additions and 1 deletions

View File

@ -158,7 +158,9 @@ void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp) {
stack->trace[0] = pc;
if ((max_s) > 1) {
stack->max_size = max_s;
#if defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__)
#if defined(__arm__) || \
defined(__powerpc__) || defined(__powerpc64__) || \
defined(__sparc__)
_Unwind_Backtrace(Unwind_Trace, stack);
// Pop off the two ASAN functions from the backtrace.
stack->PopStackFrames(2);

View File

@ -36,6 +36,8 @@ static uptr patch_pc(uptr pc) {
#if defined(__powerpc__) || defined(__powerpc64__)
// PCs are always 4 byte aligned.
return pc - 4;
#elif defined(__sparc__)
return pc - 8;
#else
return pc - 1;
#endif