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

Chris Lattner clattner at apple.com
Sun Dec 5 10:42:05 PST 2010


On Dec 3, 2010, at 12:36 PM, Frits van Bommel wrote:

> 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.

Looks great Frits, please apply!  Thanks,

-Chris



More information about the llvm-commits mailing list