[llvm-commits] [Review request] [PR 4170] insertvalue/extractvalue: reject out-of-bounds indices.

Frits van Bommel fvbommel at gmail.com
Fri Dec 3 12:36:01 PST 2010


The attached patches fix ExtractValueInst::getIndexedType() to reject
out-of-bounds indexing. This is PR 4170.

The first patch adds two tests (for insertvalue and extractvalue with
out of bounds indices). I wasn't sure where to add them but since the
error they test for is first caught by the assembler, that's where I
put the tests. (The verifier should also catch them, but it never gets
that far)
The second actually fixes above-mentioned function. It also adds
asserts that the indices are valid in InsertValueInst::init().
ExtractValueInst already asserts when constructed with invalid
indices.
The third patch clarifies some of the differences between indexing
with getelementptr and indexing with insertvalue/extractvalue in
LangRef.html.

Okay to commit?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 006-extractvalue-invalid-index-tests.patch
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101203/97565483/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 007-extractvalue-getindexedtype.patch
Type: text/x-patch
Size: 2739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101203/97565483/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 008-extractvalue-insertvalue-langref.patch
Type: text/x-patch
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101203/97565483/attachment-0002.bin>


More information about the llvm-commits mailing list