diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/infcall.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8fbc023..6d7a7cf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2015-05-19 Jan Kratochvil <jan.kratochvil@redhat.com> + Fix ASAN crash for gdb.compile/compile.exp. + * infcall.c (call_function_by_hand_dummy): Use xstrdup for NAME. + +2015-05-19 Jan Kratochvil <jan.kratochvil@redhat.com> + * compile/compile-c-symbols.c (convert_symbol_sym, gcc_convert_symbol) (gcc_symbol_address): Change gdb_stdout to gdb_stdlog. * compile/compile-object-load.c (setup_sections, compile_object_load): diff --git a/gdb/infcall.c b/gdb/infcall.c index 5dd908d..f79afea 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -1104,8 +1104,11 @@ When the function is done executing, GDB will silently stop."), if (stopped_by_random_signal || stop_stack_dummy != STOP_STACK_DUMMY) { - const char *name = get_function_name (funaddr, - name_buf, sizeof (name_buf)); + /* Make a copy as NAME may be in an objfile freed by dummy_frame_pop. */ + char *name = xstrdup (get_function_name (funaddr, + name_buf, sizeof (name_buf))); + make_cleanup (xfree, name); + if (stopped_by_random_signal) { |