StringOperations.cpp test re-defines WTF::StringTypeAdapter implementation, undefined behaviour StringOperations.cpp re-defines the template implementations in order to count the String copies. This is undefined behaviour. Two different compilation units linked to same binary cannot have two different implementations for the same name symbol. The linker knows of two different implementations by the same name, and may do whatever. Consider: // header.h inline int myFunc() { WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); return 1; } // impl1.cpp: #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() (void()) #include "header.h" void call1() { myFunc(); } // impl2.cpp: #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() printf("kimmo") #include "header.h" void call2() { myFunc(); } // main.cpp void call1(); void call2(); int main() { call1(); call2(); return 0; } c++ impl1.cpp impl2.cpp main.cpp -o my-undefined It's unclear what the app does. Currently, all invocations of TestWTF seem to use the test-overridden hack of the implementation.
<rdar://problem/101669240>
Pull request: https://github.com/WebKit/WebKit/pull/5893
Committed 256131@main (d4f69df7d5b1): <https://commits.webkit.org/256131@main> Reviewed commits have been landed. Closing PR #5893 and removing active labels.