There are many many ways this should have been caught before it even left the building by numerous automated tools. Heck most modern IDEs will flag unreachable code in the editor so there is no real excuse for this. (Adding -Wunreachable-code to a sample project in Xcode immediately flags the next line).
The programmer is human which is why automated verification tools exist.
(AppCode's default inspections will also flag the issue providing you run them)
I am not familiar with running static analysis and looking output, only did very minimal undefined behavior santisizer detection.
Lax development is par for the course at these mega corps.
For example, according to the Wayback Machine, our sites page had an entry about it since 2009:
http://web.archive.org/web/20091123132855/http://www.chromiu...
http://www.reddit.com/r/programming/comments/mw2sn/googles_a...
You take the experienced people off the shop floor, and call them inspectors. So now the quality of product coming off the shop floor is worse.
Ann is the first inspector in the chain. When she's busy (and remember, she will be because quality has dropped) she might be tempted to let a few things go because Bob, the second inspector in the chain, is bound to catch them. That's what he's there for.
Bob is the second inspector in the chain. Sometimes Ann really churns the product through. Luckily during those busy times he knows she's already inspected the stuff, so he only needs to give a 10% inspection.
So you have worse product with more errors and leaky inspection.
Ideally you'd have a system with skilled workers and self inspection. That's okay for aerospace (which pays well) but not so great for lower cost product.
Not quite sure how this transfers to coding.
How about this:
owner/peer of the module has to sign off, and randomly select two more. One must be QA and one is another programmer who works on the module. We can also pick a "junior" level, but then that's probably not going to work since Apple employes programmers who have some years of experience already. Or we can pick someone who isn't directly working on that module, but have some qualification to do review. Mostly just asking "why are you having two goto, why return -100 here)
But I see counterargument: they will just listen to the author if he's senior or the owner who is also a senior. Their words carry weight.