Change find_pcs_for_symtab_line to return a std::vector
[deliverable/binutils-gdb.git] / gdb / symtab.c
index cc2f4001e0db43309edbde25dbb138f3fe2a7ee5..20ef76ddd84a3e05ad54304963cf3eb8eb2fe96d 100644 (file)
@@ -3289,15 +3289,15 @@ done:
 }
 
 /* Given SYMTAB, returns all the PCs function in the symtab that
-   exactly match LINE.  Returns NULL if there are no exact matches,
-   but updates BEST_ITEM in this case.  */
+   exactly match LINE.  Returns an empty vector if there are no exact
+   matches, but updates BEST_ITEM in this case.  */
 
-VEC (CORE_ADDR) *
+std::vector<CORE_ADDR>
 find_pcs_for_symtab_line (struct symtab *symtab, int line,
                          struct linetable_entry **best_item)
 {
   int start = 0;
-  VEC (CORE_ADDR) *result = NULL;
+  std::vector<CORE_ADDR> result;
 
   /* First, collect all the PCs that are at this line.  */
   while (1)
@@ -3320,8 +3320,7 @@ find_pcs_for_symtab_line (struct symtab *symtab, int line,
          break;
        }
 
-      VEC_safe_push (CORE_ADDR, result,
-                    SYMTAB_LINETABLE (symtab)->item[idx].pc);
+      result.push_back (SYMTAB_LINETABLE (symtab)->item[idx].pc);
       start = idx + 1;
     }
 
This page took 0.025102 seconds and 4 git commands to generate.