1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Added asserts to prevent negative shift amounts from being generated.

llvm-svn: 7640
This commit is contained in:
Misha Brukman 2003-08-06 16:28:49 +00:00
parent 2f831da9af
commit ad7dda52c9

View File

@ -131,6 +131,7 @@ void CodeEmitterGen::run(std::ostream &o) {
// Mask off the right bits
// Low mask (ie. shift, if necessary)
assert(endBitInVar >= 0 && "Negative shift amount in masking!");
if (endBitInVar != 0) {
o << " op" << OpOrder[Vals[i].getName()]
<< " >>= " << endBitInVar << ";\n";
@ -143,6 +144,7 @@ void CodeEmitterGen::run(std::ostream &o) {
<< " &= (1<<" << beginBitInVar+1 << ") - 1;\n";
// Shift the value to the correct place (according to place in inst)
assert(endBitInInst >= 0 && "Negative shift amount in inst position!");
if (endBitInInst != 0)
o << " op" << OpOrder[Vals[i].getName()]
<< " <<= " << endBitInInst << ";\n";