Status: New
Owner: ----

New issue 1814 by [email protected]: OS::Allocate does not clear *allocated on faliure, and AllocateRawMemory does not properly check for that failure.
http://code.google.com/p/v8/issues/detail?id=1814

If OS::Allocate() fails to allocate memory, it returns NULL but it fails to set *allocated to 0. AllocateRawMemory() uses the value of *allocated before it checks for a null return value from OS::Allocate, which is a bug in itself. This can cause a SEGV instead of a clean panic.

You could have a convention that if the return value is NULL, *allocated is undefined, but that's kind of arbitrary (why not the other way around, for instance) and it would be better to keep the two values consistent.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to