llvm-project/llvm/test
David Majnemer bd4fef4a89 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

llvm-svn: 194220
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 Change objectsize intrinsic to accept different address spaces. 2013-10-07 18:06:48 +00:00
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 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
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 Implement function prefix data as an IR feature. 2013-09-16 01:08:15 +00:00
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 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
JitListener Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
LTO A better fix that also works on ppc: add a target tripple. 2013-11-02 06:00:09 +00:00
Linker Debug Info: remove duplication of DIEs when a DIE can be shared across CUs. 2013-10-31 17:54:35 +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
Transforms IR: Do not canonicalize constant GEPs into an out-of-bounds array access 2013-11-07 22:15:53 +00:00
Unit [tests] Update to use lit_config and lit package, as appropriate. 2013-08-09 16:22:05 +00:00
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
tools Revert "Added basic unit test for llvm-cov." 2013-11-05 01:56:26 +00:00
CMakeLists.txt lit: add missing substitutions for recently added tools 2013-10-28 23:37:49 +00:00
Makefile Fix LTO handling of module-level assembly (PR14152). 2013-09-19 22:15:52 +00:00
Makefile.tests Remove dead code from the makefile build system. 2013-07-25 20:25:31 +00:00
TestRunner.sh
lit.cfg lit: add missing substitutions for recently added tools 2013-10-28 23:37:49 +00:00
lit.site.cfg.in Fix LTO handling of module-level assembly (PR14152). 2013-09-19 22:15:52 +00:00