On Tue, May 26, 2009 at 11:31 PM, Brett Wilson <[email protected]> wrote:
> Don't bother doing an assertion when the next line will crash anyway: > DCHECK(foo); > foo->DoSomething(); > will normally crash pretty obviously dereferencing a NULL pointer > (even though it will be inside DoSomething). Well, that all depends on what DoSomething does, what happens to be in low memory, whether or not it's also passed an index that's applied to some component of "this", etc. If foo *can* be NULL at that point, for whatever reason, not checking it before calling DoSomething is probably a recipe for a security hole. I'd be much happier if DCHECK exited immediately rather than relying on the code to crash, or we insisted that code using DCHECK *always* attempt to recover. --Amanda --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
