aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-04-24 18:42:47 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-04-24 18:42:47 +0000
commitaacb8a5809eaef4c2dccbb8aa34157310662fc8b (patch)
tree4f6a8015a04847a2af261ac9a5904452e50fa9c3 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent1e75fc1fe1a85d720248033f04c797026e1004d4 (diff)
downloadllvm-aacb8a5809eaef4c2dccbb8aa34157310662fc8b.zip
llvm-aacb8a5809eaef4c2dccbb8aa34157310662fc8b.tar.gz
llvm-aacb8a5809eaef4c2dccbb8aa34157310662fc8b.tar.bz2
Fix a crash on valid (if UB) bitcode that is produced for some global
constants in C++11 mode. I have no idea why it required such particular circumstances to get here, the code seems clearly to rely upon unchecked assumptions. Specifically, when we decide to form an index into a struct type, we may have gone through (at least one) zero-length array indexing round, which would have left the offset un-adjusted, and thus not necessarily valid for use when indexing the struct type. This is just an canonicalization step, so the correct thing is to refuse to canonicalize nonsensical GEPs of this form. Implemented, and test case added. Fixes PR12642. Pair debugged and coded with Richard Smith. =] I credit him with most of the debugging, and preventing me from writing the wrong code. llvm-svn: 155466
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions