[all-commits] [llvm/llvm-project] 454c14: [BOLT][NFC] Fix undefined behavior in encodeAnnota...

Amir Ayupov via All-commits all-commits at lists.llvm.org
Wed Feb 23 16:03:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 454c149898d37b8e227f0d0347f7abd7ecc715e0
      https://github.com/llvm/llvm-project/commit/454c149898d37b8e227f0d0347f7abd7ecc715e0
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2022-02-23 (Wed, 23 Feb 2022)

  Changed paths:
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/unittests/Core/CMakeLists.txt
    M bolt/unittests/Core/MCPlusBuilder.cpp

  Log Message:
  -----------
  [BOLT][NFC] Fix undefined behavior in encodeAnnotationImm

Fix UBSan-reported issue in MCPlusBuilder::encodeAnnotationImm (left shift of a
negative value).

Test Plan:
```
ninja check-bolt
...
PASS: BOLT-Unit :: Core/./CoreTests/AArch64/MCPlusBuilderTester.Annotation/0 (1 of 140)
PASS: BOLT-Unit :: Core/./CoreTests/X86/MCPlusBuilderTester.Annotation/0 (131 of 134)
```

Reviewed By: maksfb, yota9

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




More information about the All-commits mailing list