#include "reloc.h"
#include "dwarf_reader.h"
-namespace {
+namespace gold {
// Read an unsigned LEB128 number. Each byte contains 7 bits of
// information, plus one bit saying whether the number continues or
do
{
+ if (num_read >= 64 / 7)
+ {
+ gold_warning(_("Unusually large LEB128 decoded, "
+ "debug information may be corrupted"));
+ break;
+ }
byte = *buffer++;
num_read++;
result |= (static_cast<uint64_t>(byte & 0x7f)) << shift;
do
{
+ if (num_read >= 64 / 7)
+ {
+ gold_warning(_("Unusually large LEB128 decoded, "
+ "debug information may be corrupted"));
+ break;
+ }
byte = *buffer++;
num_read++;
result |= (static_cast<uint64_t>(byte & 0x7f) << shift);
return result;
}
-} // End anonymous namespace.
-
-
-namespace gold {
-
// This is the format of a DWARF2/3 line state machine that we process
// opcodes using. There is no need for anything outside the lineinfo
// processor to know how this works.