Skip to content
  • Milian Wolff's avatar
    Don't crash when signatures don't match in AdaptSignatureAssistant · 2720f349
    Milian Wolff authored and Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau committed
    When the old positions overflow the new list of available declarations,
    do not crash. This could happen due to parse errors or any other
    discrepancy in counts. Should fixes the following assert I just
    encountered:
    
    ```
    [KCrash Handler]
    #6  0x00007fc6324a3f25 in raise () from /usr/lib/libc.so.6
    #7  0x00007fc63248d897 in abort () from /usr/lib/libc.so.6
    #8  0x00007fc632a0996c in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
    #9  0x00007fc632a08d52 in qt_assert_x(char const*, char const*, char const*, int) () from /usr/lib/libQt5Core.so.5
    #10 0x00007fc5f508be69 in QVector<KDevelop::Declaration*>::operator[] (this=0x7ffc9cfb01a0, i=1) at /usr/include/qt/QtCore/qvector.h:463
    #11 0x00007fc5f508a4a6 in AdaptSignatureAssistant::getRenameActions (this=0x5621d5cd80e0, newSignature=..., oldPositions=...) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/plugins/clang/codegen/adaptsignatureassistant.cpp:246
    ```
    
    (cherry picked from commit a5cf36fe)
    2720f349