@@ -549,6 +549,17 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(v
549549
550550#ifdef __cplusplus
551551
552+ // The combination of line, file, function, and counter should be a unique number per call to this crash. This tricks the compiler into not coalescing calls to WTFCrashWithInfo.
553+ // The easiest way to fill these values per translation unit is to pass __LINE__, __FILE__, WTF_PRETTY_FUNCTION, and __COUNTER__.
554+ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfoImpl (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3, uint64_t misc4, uint64_t misc5, uint64_t misc6);
555+ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfoImpl (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3, uint64_t misc4, uint64_t misc5);
556+ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfoImpl (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3, uint64_t misc4);
557+ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfoImpl (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3);
558+ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfoImpl (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2);
559+ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfoImpl (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1);
560+ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfoImpl (int line, const char * file, const char * function, int counter, uint64_t reason);
561+ NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter);
562+
552563template <typename T>
553564ALWAYS_INLINE uint64_t wtfCrashArg (T* arg) { return reinterpret_cast <uintptr_t >(arg); }
554565
@@ -558,56 +569,45 @@ ALWAYS_INLINE uint64_t wtfCrashArg(T arg) { return arg; }
558569template <typename T>
559570NO_RETURN_DUE_TO_CRASH ALWAYS_INLINE void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, T reason)
560571{
561- WTFCrashWithInfo (line, file, function, counter, wtfCrashArg (reason));
572+ WTFCrashWithInfoImpl (line, file, function, counter, wtfCrashArg (reason));
562573}
563574
564575template <typename T, typename U>
565576NO_RETURN_DUE_TO_CRASH ALWAYS_INLINE void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, T reason, U misc1)
566577{
567- WTFCrashWithInfo (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1));
578+ WTFCrashWithInfoImpl (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1));
568579}
569580
570581template <typename T, typename U, typename V>
571582NO_RETURN_DUE_TO_CRASH ALWAYS_INLINE void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, T reason, U misc1, V misc2)
572583{
573- WTFCrashWithInfo (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2));
584+ WTFCrashWithInfoImpl (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2));
574585}
575586
576587template <typename T, typename U, typename V, typename W>
577588NO_RETURN_DUE_TO_CRASH ALWAYS_INLINE void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, T reason, U misc1, V misc2, W misc3)
578589{
579- WTFCrashWithInfo (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3));
590+ WTFCrashWithInfoImpl (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3));
580591}
581592
582593template <typename T, typename U, typename V, typename W, typename X>
583594NO_RETURN_DUE_TO_CRASH ALWAYS_INLINE void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, T reason, U misc1, V misc2, W misc3, X misc4)
584595{
585- WTFCrashWithInfo (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3), wtfCrashArg (misc4));
596+ WTFCrashWithInfoImpl (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3), wtfCrashArg (misc4));
586597}
587598
588599template <typename T, typename U, typename V, typename W, typename X, typename Y>
589600NO_RETURN_DUE_TO_CRASH ALWAYS_INLINE void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, T reason, U misc1, V misc2, W misc3, X misc4, Y misc5)
590601{
591- WTFCrashWithInfo (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3), wtfCrashArg (misc4), wtfCrashArg (misc5));
602+ WTFCrashWithInfoImpl (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3), wtfCrashArg (misc4), wtfCrashArg (misc5));
592603}
593604
594605template <typename T, typename U, typename V, typename W, typename X, typename Y, typename Z>
595606NO_RETURN_DUE_TO_CRASH ALWAYS_INLINE void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, T reason, U misc1, V misc2, W misc3, X misc4, Y misc5, Z misc6)
596607{
597- WTFCrashWithInfo (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3), wtfCrashArg (misc4), wtfCrashArg (misc5), wtfCrashArg (misc6));
608+ WTFCrashWithInfoImpl (line, file, function, counter, wtfCrashArg (reason), wtfCrashArg (misc1), wtfCrashArg (misc2), wtfCrashArg (misc3), wtfCrashArg (misc4), wtfCrashArg (misc5), wtfCrashArg (misc6));
598609}
599610
600- // The combination of line, file, function, and counter should be a unique number per call to this crash. This tricks the compiler into not coalescing calls to WTFCrashWithInfo.
601- // The easiest way to fill these values per translation unit is to pass __LINE__, __FILE__, WTF_PRETTY_FUNCTION, and __COUNTER__.
602- WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3, uint64_t misc4, uint64_t misc5, uint64_t misc6);
603- WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3, uint64_t misc4, uint64_t misc5);
604- WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3, uint64_t misc4);
605- WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2, uint64_t misc3);
606- WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2);
607- WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, uint64_t reason, uint64_t misc1);
608- WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter, uint64_t reason);
609- NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo (int line, const char * file, const char * function, int counter);
610-
611611inline void WTFCrashWithInfo (int , const char *, const char *, int )
612612#if COMPILER(CLANG)
613613 __attribute__ ((optnone))
0 commit comments