[llvm-commits] [llvm-gcc-4.2] r67690 - in	/llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h
    Duncan Sands 
    baldrick at free.fr
       
    Wed Mar 25 10:13:15 PDT 2009
    
    
  
Hi Evan,
> +  if (BitCastInst *BC = dyn_cast<BitCastInst>(Size))
> +    Size = BC->getOperand(0);
why would this ever be a bitcast?
> +  ConstantInt *LenCI = dyn_cast<ConstantInt>(Len);
> +  if (!LenCI)
> +    return false;
If Size can be a bitcast, why not Len?
> +  if (LenCI->getZExtValue() >= SizeCI->getZExtValue()) {
This will blow up if Len or Size doesn't fit in 64 bits.
Of course real code will never have such big values, but
that's no reason ignore this possibility.
Ciao,
Duncan.
    
    
More information about the llvm-commits
mailing list