llvm-6502/test
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
Assembler
Bindings [OCaml] Impement Llvm_irreader, bindings to LLVM assembly parser 2013-11-06 09:21:25 +00:00
Bitcode Change BitcodeReader to use error_code instead of bool + string. 2013-11-04 16:16:24 +00:00
BugPoint
CodeGen R600: Fix LowerUDIVREM 2013-11-06 17:36:04 +00:00
DebugInfo DebugInfo: regenerate test case from Clang to adjust for fixes/improvements 2013-11-01 22:29:28 +00:00
ExecutionEngine [mips] XFAIL several MCJIT remote tests 2013-10-31 18:10:25 +00:00
Feature
FileCheck Add FileCheck tests for @LINE 2013-10-31 18:18:09 +00:00
Instrumentation fix PR17635: false positive with packed structures 2013-10-24 09:17:24 +00:00
Integer
JitListener
Linker Debug Info: remove duplication of DIEs when a DIE can be shared across CUs. 2013-10-31 17:54:35 +00:00
LTO A better fix that also works on ppc: add a target tripple. 2013-11-02 06:00:09 +00:00
MC Support for microMIPS trap instructions 1. 2013-11-07 14:35:24 +00:00
Object Fix llvm-nm to mach OS X's nm on some tests. 2013-11-02 05:03:24 +00:00
Other Provide a test input for opt 2013-11-05 13:57:34 +00:00
TableGen Enable variable arguments support for intrinsics. 2013-10-31 17:18:11 +00:00
tools Revert "Added basic unit test for llvm-cov." 2013-11-05 01:56:26 +00:00
Transforms IR: Do not canonicalize constant GEPs into an out-of-bounds array access 2013-11-07 22:15:53 +00:00
Unit
Verifier Add Verifier test case for variable argument intrinsics. 2013-10-31 17:18:17 +00:00
YAMLParser [Support][YAML] Add support for accessing tags and tag handle substitution. 2013-10-18 22:38:04 +00:00
CMakeLists.txt lit: add missing substitutions for recently added tools 2013-10-28 23:37:49 +00:00
lit.cfg lit: add missing substitutions for recently added tools 2013-10-28 23:37:49 +00:00
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh