Changeset 232215 in webkit
- Timestamp:
- May 25, 2018 4:45:36 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r232211 r232215 1 2018-05-25 Mark Lam <mark.lam@apple.com> 2 3 MachineContext's instructionPointer() should handle null PCs correctly. 4 https://bugs.webkit.org/show_bug.cgi?id=186004 5 <rdar://problem/40570067> 6 7 Reviewed by Saam Barati. 8 9 instructionPointer() returns a MacroAssemblerCodePtr<CFunctionPtrTag>. However, 10 MacroAssemblerCodePtr's constructor does not accept a null pointer value and will 11 assert accordingly with a debug ASSERT. This is inconsequential for release 12 builds, but to avoid this assertion failure, we should check for a null PC and 13 return MacroAssemblerCodePtr<CFunctionPtrTag>(nullptr) instead (which uses the 14 MacroAssemblerCodePtr(std::nullptr_t) version of the constructor instead). 15 16 Alternatively, we can change all of MacroAssemblerCodePtr's constructors to check 17 for null pointers, but I rather not do that yet. In general, 18 MacroAssemblerCodePtrs are constructed with non-null pointers, and I prefer to 19 leave it that way for now. 20 21 Note: this assertion failure only manifests when we have signal traps enabled, 22 and encounter a null pointer deref. 23 24 * runtime/MachineContext.h: 25 (JSC::MachineContext::instructionPointer): 26 1 27 2018-05-25 Mark Lam <mark.lam@apple.com> 2 28 -
trunk/Source/JavaScriptCore/runtime/MachineContext.h
r231227 r232215 439 439 void* value = instructionPointerImpl(const_cast<PlatformRegisters&>(regs)); 440 440 #endif 441 if (!value) 442 return MacroAssemblerCodePtr<CFunctionPtrTag>(nullptr); 441 443 return MacroAssemblerCodePtr<CFunctionPtrTag>(value); 442 444 }
Note: See TracChangeset
for help on using the changeset viewer.