forked from Imagelibrary/binutils-gdb
* stringpool.cc (Stringpool_template::add_with_length): Set key to
array size plus one. (Stringpool_template::set_string_offsets): Subtract one from key before using it as an array index. (Stringpool_template::get_offset_with_length): Likewise. (Stringpool_template::write_to_buffer): Likewise. * stringpool.h (Stringpool_template::get_offset_from_key): Likewise.
This commit is contained in:
@@ -220,8 +220,8 @@ class Stringpool_template
|
||||
section_offset_type
|
||||
get_offset_from_key(Key k) const
|
||||
{
|
||||
gold_assert(k < this->key_to_offset_.size());
|
||||
return this->key_to_offset_[k];
|
||||
gold_assert(k <= this->key_to_offset_.size());
|
||||
return this->key_to_offset_[k - 1];
|
||||
}
|
||||
|
||||
// Get the size of the string table. This returns the number of
|
||||
|
||||
Reference in New Issue
Block a user