[llvm-commits] [PATCH] Object: avoid undefined behavior when bounds-checking

Michael Spencer bigcheesegs at gmail.com
Fri Feb 3 15:50:42 PST 2012


On Fri, Feb 3, 2012 at 6:14 AM, nobled <nobled at dreamwidth.org> wrote:
> Duh, with patch this time...
>
>> Don't form an out of bounds pointer just to test if it would be out of
>> bounds (i.e. the comparison "if (SectionHeaderTable + SectionTableSize
>>> base() + Data->getBufferSize())").
>>
>> Also add the same bounds checking for all the previous
>> mapped structures.

LGTM. Although one of these days I would like to get around to
handling errors properly as the COFF reader does.

- Michael Spencer



More information about the llvm-commits mailing list