llvm-6502/lib
David Majnemer 0ab2058852 IR: Do not canonicalize constant GEPs into an out-of-bounds array access
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-07 22:15:53 +00:00
..
Analysis Rewrite SCEV's backedge taken count computation. 2013-11-06 02:08:26 +00:00
AsmParser Remove linkonce_odr_auto_hide. 2013-11-01 17:09:14 +00:00
Bitcode Use error_code in GVMaterializer. 2013-11-05 19:36:34 +00:00
CodeGen Slightly change the way stackmap and patchpoint intrinsics are lowered. 2013-11-05 22:44:04 +00:00
DebugInfo DebugInfo: Make pubnames header printing similar to unit header printing 2013-11-01 17:53:30 +00:00
ExecutionEngine The FIXME was indeed fixed in the linker, comment removed. 2013-10-25 12:01:53 +00:00
IR IR: Do not canonicalize constant GEPs into an out-of-bounds array access 2013-11-07 22:15:53 +00:00
IRReader [llvm-c] Expose IRReader interface 2013-11-06 09:21:15 +00:00
Linker Move copying of global initializers below the cloning of functions. 2013-11-07 20:14:51 +00:00
LTO Remove linkonce_odr_auto_hide. 2013-11-01 17:09:14 +00:00
MC Add to the disassembler C API output reference types for 2013-11-01 00:00:07 +00:00
Object Support for microMIPS branch instructions. 2013-11-04 14:53:22 +00:00
Option Use startswith_lower() where possible. 2013-11-04 19:22:50 +00:00
Support Add newline at EOF in DynamicLibrary.cpp 2013-11-06 11:12:46 +00:00
TableGen Fix most memory leaks in tablegen. 2013-10-31 04:07:41 +00:00
Target Support for microMIPS trap instructions 1. 2013-11-07 14:35:24 +00:00
Transforms [objc-arc] Convert the one directional retain/release relation assert to a conditional check + fail. 2013-11-05 16:02:40 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile Reformat Makefile. No other changes. 2013-10-30 04:03:03 +00:00