[all-commits] [llvm/llvm-project] 6dccad: [lldb/Reproducers] (De)serialize char* like const ...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Wed Feb 5 14:52:12 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6dccad7517f83a069d9bfbf761b648b0e50870c2
      https://github.com/llvm/llvm-project/commit/6dccad7517f83a069d9bfbf761b648b0e50870c2
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2020-02-05 (Wed, 05 Feb 2020)

  Changed paths:
    M lldb/include/lldb/Utility/ReproducerInstrumentation.h

  Log Message:
  -----------
  [lldb/Reproducers] (De)serialize char* like const char*

The current implementation has a discrepancy between how char pointers
are serialized and deserialized. The latter treats it like a const char*
while the former serializes it as a pointer to a basic type.

Both are potentially wrong, as char pointers are mostly used in
combination with a size, and nothing guarantees that the string's length
(its first null byte to be more precise) is greater or equal to its
size. The real solution is to have a custom (de)serializer that uses
both pieces of infromation.

However, the implementation should be consistent between serialization
and deserialization and I believe treating char* as const char* is the
better alternative.


  Commit: fefff970321a4fe0b717f3679e291bd53ee82ef6
      https://github.com/llvm/llvm-project/commit/fefff970321a4fe0b717f3679e291bd53ee82ef6
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2020-02-05 (Wed, 05 Feb 2020)

  Changed paths:
    M lldb/tools/debugserver/source/CMakeLists.txt

  Log Message:
  -----------
  [lldb/debugserver] Link against Security


Compare: https://github.com/llvm/llvm-project/compare/3ec28da6d643...fefff970321a


More information about the All-commits mailing list