[all-commits] [llvm/llvm-project] a35efc: Misleading unicode identifier detection pass

serge-sans-paille via All-commits all-commits at lists.llvm.org
Wed Nov 10 01:22:31 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a35efc4dcb70658ebd704c28dfeed4cc2bac095b
      https://github.com/llvm/llvm-project/commit/a35efc4dcb70658ebd704c28dfeed4cc2bac095b
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2021-11-10 (Wed, 10 Nov 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/misc/CMakeLists.txt
    M clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
    A clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp
    A clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/docs/clang-tidy/checks/misc-misleading-identifier.rst
    M clang-tools-extra/test/clang-tidy/check_clang_tidy.py
    A clang-tools-extra/test/clang-tidy/checkers/misc-misleading-identifier.cpp

  Log Message:
  -----------
  Misleading unicode identifier detection pass

Detect when an identifier contains some Right-To-Left characters.
This pass relates to https://trojansource.codes/

Example of misleading source:

    short int א = (short int)0;
    short int ג = (short int)12345;

    int main() {
      int א = ג; // a local variable, set to zero?
      printf("ג is %d\n", ג);
      printf("א is %d\n", א);
    }

This is a recommit of 299aa4dfa1d8c120648b1404b481d858b76c8173 with missing
option registration fixed.

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




More information about the All-commits mailing list