[all-commits] [llvm/llvm-project] ff2e61: [clang] remove dereferencing of invalid pointer

Ashay Rane via All-commits all-commits at lists.llvm.org
Mon Apr 24 08:37:27 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff2e6199b23525b06947785368cc3e2e93eab381
      https://github.com/llvm/llvm-project/commit/ff2e6199b23525b06947785368cc3e2e93eab381
  Author: Ashay Rane <ashay at users.noreply.github.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M llvm/include/llvm/Demangle/ItaniumDemangle.h

  Log Message:
  -----------
  [clang] remove dereferencing of invalid pointer

A line in the demangling code for float literals dereferences the
`.end()` iterator, which causes the Windows debug build of llvm-cxxfilt
to crash.  The failure can be reproduced by passing the string
`_Z5dummyIXtl8wrapper1IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_ELd405ec00000000000EEEEEEvv`
to `llvm-cxxfilt -n`.

This patch rewrites the code to use the `.size()` member of the
string_view type to avoid dereferencing past the buffer.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D149061




More information about the All-commits mailing list