[llvm-commits] [compiler-rt] r168151 - /compiler-rt/trunk/lib/asan/asan_linux.cc

Dmitry Vyukov dvyukov at google.com
Fri Nov 16 03:26:05 PST 2012


Author: dvyukov
Date: Fri Nov 16 05:26:05 2012
New Revision: 168151

URL: http://llvm.org/viewvc/llvm-project?rev=168151&view=rev
Log:
asan: sync with gcc r193553

Modified:
    compiler-rt/trunk/lib/asan/asan_linux.cc

Modified: compiler-rt/trunk/lib/asan/asan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_linux.cc?rev=168151&r1=168150&r2=168151&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_linux.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_linux.cc Fri Nov 16 05:26:05 2012
@@ -68,6 +68,20 @@
   *pc = ucontext->uc_mcontext.gregs[REG_EIP];
   *bp = ucontext->uc_mcontext.gregs[REG_EBP];
   *sp = ucontext->uc_mcontext.gregs[REG_ESP];
+# elif defined(__sparc__)
+  ucontext_t *ucontext = (ucontext_t*)context;
+  uptr *stk_ptr;
+# if defined (__arch64__)
+  *pc = ucontext->uc_mcontext.mc_gregs[MC_PC];
+  *sp = ucontext->uc_mcontext.mc_gregs[MC_O6];
+  stk_ptr = (uptr *) (*sp + 2047);
+  *bp = stk_ptr[15];
+# else
+  *pc = ucontext->uc_mcontext.gregs[REG_PC];
+  *sp = ucontext->uc_mcontext.gregs[REG_O6];
+  stk_ptr = (uptr *) *sp;
+  *bp = stk_ptr[15];
+# endif
 #else
 # error "Unsupported arch"
 #endif





More information about the llvm-commits mailing list