MCExpr: Avoid UB by evaluating this shift as unsigned
authorJustin Bogner <mail@justinbogner.com>
Tue, 23 Jun 2015 07:32:55 +0000 (07:32 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 23 Jun 2015 07:32:55 +0000 (07:32 +0000)
commit1e4a7e02f84e3ff320ebb5fdaf04dff29a4e70f3
treeb29281e133bc6cd327f563090a55f61e34c31723
parent46a8f931444363ad3387ae26189e83dc16155696
MCExpr: Avoid UB by evaluating this shift as unsigned

We hit undefined behaviour in some MCExpr tests when the LHS of a left
shift is -1. Twos-complement semantics are completely reasonable here,
so we should just do the shift in unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240385 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCExpr.cpp