[PATCH] D143471: [X86][MC][NFC] Refine code in X86MCCodeEmitter.cpp about opcode prefix

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 05:17:39 PST 2023


skan added a comment.

In D143471#4117637 <https://reviews.llvm.org/D143471#4117637>, @uabelho wrote:

> Hi,
>
> I noticed that if I run lit tests with ubsan built binaries with this patch there are many many tests failing like
>
>   ../lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp:222:19: runtime error: left shift of negative value -1

I think it's false positive?

  ~R << 7

`R` is an `unsigned`, so `~R` is `unsigned` too. Although the value of `~R` may be `0xffffffff`. But I remember the left shift operation on `unsigned` is always well defined.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143471/new/

https://reviews.llvm.org/D143471



More information about the llvm-commits mailing list