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


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


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