Changeset 258620 in webkit
- Timestamp:
- Mar 17, 2020 8:32:31 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r258617 r258620 1 2020-03-17 David Kilzer <ddkilzer@apple.com> 2 3 SharedMemory::Handle::m_size should be more consistent 4 <https://webkit.org/b/209007> 5 <rdar://problem/60340890> 6 7 Reviewed by Darin Adler. 8 9 * Platform/cocoa/SharedMemoryCocoa.cpp: 10 (WebKit::SharedMemory::Handle::decode): 11 - Return early if an invalid `size` is decoded. 12 (WebKit::SharedMemory::map): 13 - Drive-by fix to change '0' to 'nullptr'. 14 - Since all known methods of creating a SharedMemory::Handle() 15 set SharedMemory::Handle::m_size to a value of round_page(), 16 this means we can also change `round_page(handle.m_size)` to 17 `handle.m_size` in the call to mach_vm_map() since we know 18 they're equal. 19 1 20 2020-03-17 Commit Queue <commit-queue@webkit.org> 2 21 -
trunk/Source/WebKit/Platform/cocoa/SharedMemoryCocoa.cpp
r247815 r258620 94 94 if (!decoder.decode(size)) 95 95 return false; 96 if (size != round_page(size)) 97 return false; 96 98 97 99 IPC::MachPort machPort; … … 191 193 { 192 194 if (handle.isNull()) 193 return 0;194 195 return nullptr; 196 195 197 ASSERT(round_page(handle.m_size) == handle.m_size); 196 198 197 199 vm_prot_t vmProtection = machProtection(protection); 198 200 mach_vm_address_t mappedAddress = 0; 199 kern_return_t kr = mach_vm_map(mach_task_self(), &mappedAddress, round_page(handle.m_size), 0, VM_FLAGS_ANYWHERE, handle.m_port, 0, false, vmProtection, vmProtection, VM_INHERIT_NONE);201 kern_return_t kr = mach_vm_map(mach_task_self(), &mappedAddress, handle.m_size, 0, VM_FLAGS_ANYWHERE, handle.m_port, 0, false, vmProtection, vmProtection, VM_INHERIT_NONE); 200 202 #if RELEASE_LOG_DISABLED 201 203 if (kr != KERN_SUCCESS)
Note: See TracChangeset
for help on using the changeset viewer.