Skip to content
  1. Nov 09, 2013
  2. Nov 08, 2013
  3. Nov 07, 2013
    • David Majnemer's avatar
      IR: Properly canonicalize PointerType in ConstantExpr GEPs · d3d140da
      David Majnemer authored
      No additional test was needed, Other/constant-fold-gep.ll detects this
      just fine.
      
      llvm-svn: 194221
      d3d140da
    • David Majnemer's avatar
      IR: Do not canonicalize constant GEPs into an out-of-bounds array access · bd4fef4a
      David Majnemer authored
      Summary:
      Consider a GEP of:
      i8* getelementptr ({ [2 x i8], i32, i8, [3 x i8] }* @main.c, i32 0, i32 0, i64 0)
      
      If we proceeded to GEP the aforementioned object by 8, would form a GEP of:
      i8* getelementptr ({ [2 x i8], i32, i8, [3 x i8] }* @main.c, i32 0, i32 0, i64 8)
      
      Note that we would go through the first array member, causing an
      out-of-bounds accesses.  This is problematic because we might get fooled
      if we are trying to evaluate loads using this GEP, for example, based
      off of an object with a constant initializer where the array is zero.
      
      This fixes PR17732.
      
      Reviewers: nicholas, chandlerc, void
      
      Reviewed By: void
      
      CC: llvm-commits, echristo, void, aemerson
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2093
      
      llvm-svn: 194220
      bd4fef4a
Loading