[all-commits] [llvm/llvm-project] 77b0b2: [lldb] Return an empty extractor for unmappable su...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Thu Jun 25 08:16:47 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 77b0b29955125c6caae1f88f710c4b3b41a0d37f
      https://github.com/llvm/llvm-project/commit/77b0b29955125c6caae1f88f710c4b3b41a0d37f
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M lldb/source/Utility/VirtualDataExtractor.cpp
    M lldb/unittests/Utility/VirtualDataExtractorTest.cpp

  Log Message:
  -----------
  [lldb] Return an empty extractor for unmappable subset requests (#205596)

DataExtractor::GetSubsetExtractorSP always returns a valid, non-null
extractor, and every caller relies on that: they dereference the result
directly rather than checking for null. The VirtualDataExtractor
override broke this contract. When the requested range had no backing in
the lookup table (e.g. the virtual offset fell in a gap, or the range
crossed an entry boundary) it returned an empty shared_ptr, turning each
caller's dereference into a null-pointer access.

It also asserted on those cases. But the offsets passed to a subset
request are derived from parsed file contents, which may be truncated or
inconsistent. A range that cannot be mapped is therefore ordinary input,
not a programming error, and must not abort an assertions-enabled build.

Return a valid but empty extractor instead. Reads see zero bytes and the
caller's existing size checks skip the data, matching the graceful
degradation the base class already provides for out-of-range offsets.

Assisted-by: Claude



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list