forked from Imagelibrary/binutils-gdb
Constify linetables
Linetables no longer change after they are created. This patch applies const to them. Note there is one hack to cast away const in mdebugread.c. This code allocates a linetable using 'malloc', then later copies it to the obstack. While this could be cleaned up, I chose not to do so because I have no way of testing it. Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
@@ -543,9 +543,11 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
|
||||
size_t size = ((stab->linetable->nitems - 1)
|
||||
* sizeof (struct linetable_entry)
|
||||
+ sizeof (struct linetable));
|
||||
filetab->set_linetable ((struct linetable *)
|
||||
obstack_alloc (&objfile->objfile_obstack, size));
|
||||
memcpy (filetab->linetable (), stab->linetable.get (), size);
|
||||
struct linetable *new_table
|
||||
= (struct linetable *) obstack_alloc (&objfile->objfile_obstack,
|
||||
size);
|
||||
memcpy (new_table, stab->linetable.get (), size);
|
||||
filetab->set_linetable (new_table);
|
||||
}
|
||||
|
||||
blockvector_size = (sizeof (struct blockvector)
|
||||
|
||||
Reference in New Issue
Block a user