[all-commits] [llvm/llvm-project] 43637c: Fix crash when an invalid URI is parsed and error ...

Chris Rhodes via All-commits all-commits at lists.llvm.org
Wed Apr 7 03:38:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 43637c0dfeebcf4a4fcbb331f1094662e8882430
      https://github.com/llvm/llvm-project/commit/43637c0dfeebcf4a4fcbb331f1094662e8882430
  Author: crr0004 <crr0004 at gmail.com>
  Date:   2021-04-07 (Wed, 07 Apr 2021)

  Changed paths:
    M clang-tools-extra/clangd/Protocol.cpp

  Log Message:
  -----------
  Fix crash when an invalid URI is parsed and error handling is attempted

When you pass in a payload with an invalid URI in a build with assertions enabled, it will crash.
Consuming the error from the failed URI parse prevents the error.

The crash is caused by the [llvm::expected](https://llvm.org/doxygen/classllvm_1_1Expected.html) having protection around trying to deconstruct without consuming the error first.

Reviewed By: kadircet

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




More information about the All-commits mailing list