This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgo patch committed: Use libbacktrace


Ian Lance Taylor <iant@google.com> writes:

> +/* Set *VAL to the value of the symbol for PC.  */
> +
> +static _Bool
> +__go_symbol_value (uintptr_t pc, uintptr_t *val)
> +{
> +  *val = 0;
> +  backtrace_syminfo (__go_get_backtrace_state (), pc, syminfo_callback,
> +		     error_callback, &val);
> +  return *val != 0;
>  }

Don't clobber address of val.

diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c
index 843adf6..8dcf9e4 100644
--- a/libgo/runtime/go-caller.c
+++ b/libgo/runtime/go-caller.c
@@ -144,7 +144,7 @@ __go_symbol_value (uintptr_t pc, uintptr_t *val)
 {
   *val = 0;
   backtrace_syminfo (__go_get_backtrace_state (), pc, syminfo_callback,
-		     error_callback, &val);
+		     error_callback, val);
   return *val != 0;
 }
 

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]