instructionPointer() returns a MacroAssemblerCodePtr<CFunctionPtrTag>. However MacroAssemblerCodePtr's constructor does not accept a nullptr and will assert accordingly with a debug ASSERT. This is inconsequential for release builds, but to avoid this assertion failure, we should check for a null PC and return MacroAssemblerCodePtr<CFunctionPtrTag>(nullptr) instead (which uses the MacroAssemblerCodePtr(std::nullptr_t) constructor instead). Alternatively, we can change all of MacroAssemblerCodePtr's constructors to check for null pointers, but I rather not do that yet. In general, MacroAssemblerCodePtrs are constructed with non-null pointers, and I prefer to leave it that way for now.
Note: this issue only manifests when we have signal traps enabled, and encounter a null pointer deref.
Created attachment 341354 [details] proposed patch.
<rdar://problem/40570067>
Thanks for the review. Landed in r232215: <http://trac.webkit.org/r232215>.