WTF::dynamic_cf_cast<> should not assert in Debug builds. The proper way to use dynamic_cf_cast<> is to do a nullptr check on its return results, and take action if the cast failed. One of the most common use cases is when decoding (untrusted) serialized data, and instead of crashing, we just want to fail decoding on that particular chunk serialized data. In some cases, we may way to add a nullptr check before calling it to differentiate that scenario from the wrong object type being detected. We never want to use dynamic_cf_cast<> and assume it always succeeds, though. In that case, we either want to use checked_cf_cast<> instead, or add a nullptr check to handle that scenario. <rdar://problem/73451079>
Created attachment 419318 [details] Patch v1
Comment on attachment 419318 [details] Patch v1 r=me
Created attachment 419320 [details] Patch for landing
Comment on attachment 419320 [details] Patch for landing Added comments about how to use each template function.
ChangeLog entry in Source/WTF/ChangeLog contains OOPS!.
Created attachment 419328 [details] Patch for landing v2
Committed r272392: <https://trac.webkit.org/changeset/272392> All reviewed patches have been landed. Closing bug and clearing flags on attachment 419328 [details].