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: Ian Lance Taylor <iant at google dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Sun, 7 Oct 2012 21:43:29 -0700
- Subject: Re: libgo patch committed: Use libbacktrace
- References: <mcr3922fbjw.fsf@google.com> <m2zk3ygyxs.fsf@igel.home>
On Sun, Oct 7, 2012 at 7:05 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> 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;
> }
Yikes. Thanks. Committed to mainline.
Ian