if (ObjDelegate) {
StringRef StringTable = ObjDelegate->getStringTable();
- if (!StringTable.empty()) {
- W.printString(
- "Program",
- StringTable.drop_front(DefRange.Header.Program).split('\0').first);
- }
+ auto ProgramStringTableOffset = DefRange.Header.Program;
+ if (ProgramStringTableOffset >= StringTable.size())
+ return parseError();
+ StringRef Program =
+ StringTable.drop_front(ProgramStringTableOffset).split('\0').first;
+ W.printString("Program", Program);
}
printLocalVariableAddrRange(DefRange.Header.Range,
DefRange.getRelocationOffset());