PR24427, bfd/doc/chew.c reads uninitialized memory and subtracts from function pointer
[deliverable/binutils-gdb.git] / gdb / block.c
index 3192b33e9e9c3c71e33b9b864784cd2fae01cf45..63c7d9f3955a4e149eeeb8a3c574c039b41302f2 100644 (file)
@@ -131,16 +131,16 @@ block_inlined_p (const struct block *bl)
 /* A helper function that checks whether PC is in the blockvector BL.
    It returns the containing block if there is one, or else NULL.  */
 
-static struct block *
+static const struct block *
 find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
 {
-  struct block *b;
+  const struct block *b;
   int bot, top, half;
 
   /* If we have an addrmap mapping code addresses to blocks, then use
      that.  */
   if (BLOCKVECTOR_MAP (bl))
-    return (struct block *) addrmap_find (BLOCKVECTOR_MAP (bl), pc);
+    return (const struct block *) addrmap_find (BLOCKVECTOR_MAP (bl), pc);
 
   /* Otherwise, use binary search to find the last block that starts
      before PC.
@@ -186,7 +186,7 @@ blockvector_for_pc_sect (CORE_ADDR pc, struct obj_section *section,
                         struct compunit_symtab *cust)
 {
   const struct blockvector *bl;
-  struct block *b;
+  const struct block *b;
 
   if (cust == NULL)
     {
This page took 0.027963 seconds and 4 git commands to generate.