• Sergei Petrunia's avatar
    MDEV-21341: Fix UBSAN failures: Issue Six · 5e5ae51b
    Sergei Petrunia authored
    (Variant #2 of the patch, which keeps the sp_head object inside the
    MEM_ROOT that sp_head object owns)
    (10.3 requires extra work due to sp_package, will commit a separate
    patch for it)
    
    sp_head::operator new() and operator delete() were dereferencing sp_head*
    pointers to memory that didn't hold a valid sp_head object (it was
    not created/already destroyed).
    This caused UBSan to crash when looking up type information.
    
    Fixed by providing static sp_head::create() and sp_head::destroy() methods.
    5e5ae51b
sql_yacc.yy 493 KB