[llvm] r312353 - [TTI] Initialize a value to trigger a crash deterministically.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 12:36:34 PDT 2017


Author: davide
Date: Fri Sep  1 12:36:34 2017
New Revision: 312353

URL: http://llvm.org/viewvc/llvm-project?rev=312353&view=rev
Log:
[TTI] Initialize a value to trigger a crash deterministically.

We expect the pointer to be initialized by the above loop, but
if that's not executed, the contents are garbage.
A fix for the crash will be committed immediately after.

Modified:
    llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h

Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h?rev=312353&r1=312352&r2=312353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h (original)
+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h Fri Sep  1 12:36:34 2017
@@ -674,7 +674,7 @@ public:
     int64_t Scale = 0;
 
     auto GTI = gep_type_begin(PointeeType, Operands);
-    Type *TargetType;
+    Type *TargetType = nullptr;
     for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) {
       TargetType = GTI.getIndexedType();
       // We assume that the cost of Scalar GEP with constant index and the




More information about the llvm-commits mailing list