diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h | 3 | 
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h index ef44f9d9418..84179f5f81f 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h +++ b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h @@ -140,6 +140,9 @@ struct serialize_null_term_string_array_impl {        : Item(Item) {}    std::error_code deserialize(ArrayRef<uint8_t> &Data) const { +    if (Data.empty()) +      return std::make_error_code(std::errc::illegal_byte_sequence); +      StringRef Field;      // Stop when we run out of bytes or we hit record padding bytes.      while (Data.front() != 0) {  | 

