r175982 - PR15338: Don't assert if -fsanitize=bounds sees array indexing on an incomplete

David Blaikie dblaikie at gmail.com
Sun Feb 24 10:53:51 PST 2013


On Sat, Feb 23, 2013 at 8:04 PM, Sean Silva <silvas at purdue.edu> wrote:

> Some quick grepping appears to turn up a couple more of these. I'll
> take care of these at some point (can't promise any deadline; I'm not
> in full dev mode (watching the bots, etc.) due to school). It would be
> cool if somebody dropped in a couple fixes if they're in the area.


& I'm just going to take this opportunity to raise an option here (& I've
mentioned things like this before but they don't seem to be very popular):

cast should return references, not pointers (& I'd prefer it take
references, not pointers) and then we couldn't write this sort of bug*...
(dyn_cast could take references too, but obviously still return pointers
(or Optional<T&>, though I realize that's a bit odd))

* well, we could write similarly buggy code for cases that cast to a
boolean testable type, but they'd be a little more obvious, perhaps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130224/b7ae84d2/attachment.html>


More information about the cfe-commits mailing list