From 96431d57723de569bd75407cf7252699b491cbbe Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 11 Feb 2012 00:15:54 +0000 Subject: [PATCH] runtime: Tweak __go_can_recover for SPARC. From-SVN: r184117 --- libgo/runtime/go-recover.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libgo/runtime/go-recover.c b/libgo/runtime/go-recover.c index 7101d518ade..d6403e00d39 100644 --- a/libgo/runtime/go-recover.c +++ b/libgo/runtime/go-recover.c @@ -43,6 +43,14 @@ __go_can_recover (const void* retaddr) such as an instruction to adjust the stack pointer. */ ret = (const char *) retaddr; + +#ifdef __sparc__ + /* On SPARC the address we get, from __builtin_return_address, is + the address of the call instruction. Adjust forward, also + skipping the delayed instruction following the call. */ + ret += 8; +#endif + dret = (const char *) d->__retaddr; return ret <= dret && ret + 16 >= dret; }