[all-commits] [llvm/llvm-project] 37cba5: [clangd] check for synthesized symbols when tracki...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Mon Dec 11 18:08:50 PST 2023


  Branch: refs/heads/users/mizvekov/bug/clangd-msvc-assert-crash-fix
  Home:   https://github.com/llvm/llvm-project
  Commit: 37cba5c41d19c7def916120b1b581a99abb8877b
      https://github.com/llvm/llvm-project/commit/37cba5c41d19c7def916120b1b581a99abb8877b
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2023-12-11 (Mon, 11 Dec 2023)

  Changed paths:
    M clang-tools-extra/clangd/index/SymbolCollector.cpp
    M clang-tools-extra/clangd/test/GH75115.test

  Log Message:
  -----------
  [clangd] check for synthesized symbols when tracking include locations

This fixes https://github.com/llvm/llvm-project/issues/75115

In C mode with MSVC compatibility, when the `assert` macro is defined,
as a workaround, `static_assert` was implicitly defined as well,
if not already so, in order to work around a broken `assert.h`
implementation.
This workaround was implemented in https://github.com/llvm/llvm-project/commit/8da090381d567d0ec555840f6b2a651d2997e4b3

A synthesized symbol does not occur in source code, and therefore
should not have valid source location, but this was not checked when
inserting this into a map symbol -> include file map.

The invalid FileID value is used for empty key representation in
the include file map hash table, and it's not valid to insert it,
causing the crash.




More information about the All-commits mailing list