This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgo patch committed: Use libbacktrace
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Sun, 07 Oct 2012 16:05:19 +0200
- Subject: Re: libgo patch committed: Use libbacktrace
- References: <mcr3922fbjw.fsf@google.com>
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."