Summary: | tryReallocate could break the zero-ed memory invariant of CopiedBlocks | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Hahnenberg <mhahnenberg> | ||||||||
Component: | JavaScriptCore | Assignee: | Mark Hahnenberg <mhahnenberg> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | fpizlo, ggaren, webkit.review.bot | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Mark Hahnenberg
2012-03-23 13:58:23 PDT
Created attachment 133556 [details]
Patch
Comment on attachment 133556 [details]
Patch
I think you can simplify this code, like so:
if (m_allocator.wasLastAllocation(oldPtr, oldSize)) {
size_t delta = newSize - oldSize;
if (m_allocator.fitsInCurrentBlock(delta)) {
m_allocator.allocate(delta))
return oldPtr;
}
}
Created attachment 133586 [details]
Patch
Created attachment 133602 [details]
Patch
Comment on attachment 133602 [details]
Patch
R=me.
Comment on attachment 133602 [details] Patch Clearing flags on attachment: 133602 Committed r111973: <http://trac.webkit.org/changeset/111973> All reviewed patches have been landed. Closing bug. |