3 ms·
"new" is already infallible by default in Firefox. Most places outside of the JS engine are using infallible allocation, and have been for a number of years.
by mccr8 12y ago
"new" is already infallible by default in Firefox. Most places outside of the JS engine are using infallible allocation, and have been for a number of years.
The basic problem is that error handling for tiny allocations is unlikely to be ever tested, and thus have potentially critical security bugs. This is not merely a theoretical concern: one of the Pwn2Own exploits for Firefox last year relied on an error in some OOM handling code, resulting in remote code execution.
Instead, Firefox just crashes if an allocation fails (in most places), and Mozilla gets a crash report. If a particular allocation fails enough, usually due to being a large allocation, then it will show up in our crash statistics, and that particular location can be made fallible. The error handling code is thus being run at least sometimes, making it a little safer.