[llvm-commits] [dragonegg] r132183 - /dragonegg/trunk/src/Convert.cpp

Duncan Sands baldrick at free.fr
Fri May 27 02:50:57 PDT 2011


Author: baldrick
Date: Fri May 27 04:50:57 2011
New Revision: 132183

URL: http://llvm.org/viewvc/llvm-project?rev=132183&view=rev
Log:
If shifting a vector by a vector of shift amounts, this type
conversion might crash.  Found by inspection.

Modified:
    dragonegg/trunk/src/Convert.cpp

Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=132183&r1=132182&r2=132183&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Fri May 27 04:50:57 2011
@@ -6785,9 +6785,8 @@
   Value *LHS = EmitRegister(op0);
   Value *RHS = EmitRegister(op1);
   if (RHS->getType() != LHS->getType())
-    RHS = Builder.CreateIntCast(RHS, LHS->getType(), /*isSigned*/false,
-                                RHS->getName()+".cast");
-
+    RHS = CastToAnyType(RHS, /*isSigned*/false, LHS->getType(),
+                        /*isSigned*/false);
   return Builder.CreateBinOp((Instruction::BinaryOps)Opc, LHS, RHS);
 }
 





More information about the llvm-commits mailing list