Make UMLObject::asUMLxxx() methods able to handle zero pointer as parameter on windows.
gcc implementation of dynamic_cast consists of an inline part and a function performing the real cast. On linux (and may be other platforms) the inline part checks against null pointer parameter. This check is missing in the related windows implementation (at least with gcc 6.2) and results into a segfault on accessing the virtual table in the casting function. The fix is done using a gcc asm statement to prevent removing by the optimizer because 'this' parameter is marked as 'notnull' by default. This patch includes also a few dynamic_cast checks added to the unit tests. BUG:373911 FIXED-IN:2.21.1 (KDE Applications 16.12.1)
parent
6761c2b0
Please register or sign in to comment