* python/py-auto-load.c (info_auto_load_scripts): Pass address of
authorDoug Evans <dje@google.com>
Tue, 20 Dec 2011 04:29:35 +0000 (04:29 +0000)
committerDoug Evans <dje@google.com>
Tue, 20 Dec 2011 04:29:35 +0000 (04:29 +0000)
scripts vector to collect_matching_scripts.
(collect_matching_scripts): Update.

gdb/ChangeLog
gdb/python/py-auto-load.c

index 7c8d38f0caa702ec3e59108d7890a99a01dc2430..2eba21ac9a370387308c95c0377f43da92ada083 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-19  Doug Evans  <dje@google.com>
+
+       * python/py-auto-load.c (info_auto_load_scripts): Pass address of
+       scripts vector to collect_matching_scripts.
+       (collect_matching_scripts): Update.
+
 2011-12-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * symfile.c (reread_symbols): Move free_objfile_separate_debug,
index 62975ea10df820e803dca2e1fd4190f015e245f2..ef332ea8a1a15d25486592126680321d2bd7b543 100644 (file)
@@ -481,10 +481,10 @@ static int
 collect_matching_scripts (void **slot, void *info)
 {
   struct loaded_script *script = *slot;
-  VEC (loaded_script_ptr) *scripts = info;
+  VEC (loaded_script_ptr) **scripts_ptr = info;
 
   if (re_exec (script->name))
-    VEC_safe_push (loaded_script_ptr, scripts, script);
+    VEC_safe_push (loaded_script_ptr, *scripts_ptr, script);
 
   return 1;
 }
@@ -563,8 +563,9 @@ info_auto_load_scripts (char *pattern, int from_tty)
   if (pspace_info != NULL && pspace_info->loaded_scripts != NULL)
     {
       immediate_quit++;
+      /* Pass a pointer to scripts as VEC_safe_push can realloc space.  */
       htab_traverse_noresize (pspace_info->loaded_scripts,
-                             collect_matching_scripts, scripts);
+                             collect_matching_scripts, &scripts);
       immediate_quit--;
     }
 
This page took 0.030482 seconds and 4 git commands to generate.