Patchwork libgo patch committed: Use libbacktrace

login
register
mail settings
Submitter Andreas Schwab
Date Oct. 7, 2012, 2:05 p.m.
Message ID <m2zk3ygyxs.fsf@igel.home>
Download mbox | patch
Permalink /patch/189839/
State New
Headers show

Comments

Andreas Schwab - Oct. 7, 2012, 2:05 p.m.
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.


Andreas.
Ian Taylor - Oct. 8, 2012, 4:43 a.m.
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

Patch

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;
 }