[mips] Fix some UB by shifting before sign-extending
authorJustin Bogner <mail@justinbogner.com>
Tue, 23 Jun 2015 07:28:57 +0000 (07:28 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 23 Jun 2015 07:28:57 +0000 (07:28 +0000)
commit46a8f931444363ad3387ae26189e83dc16155696
tree42ef23a5d69d10b1b4f0b69017a02bb7c2f068b7
parenta915f41453040447afaf64cf68a84c93eadf5c88
[mips] Fix some UB by shifting before sign-extending

Avoid shifting a negative value by sign-extending after the shift.

Fixes a couple of tests that were failing under ubsan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240381 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/Disassembler/MipsDisassembler.cpp