• Harris Hancock's avatar
    Fix crashes due to null vtable pointers with MSVC · 2e7ece6b
    Harris Hancock authored
    MSVC as of VS2015 does not initialize the vtable pointers of constexpr
    objects, causing nullptr dereferences at runtime. To solve this, we can
    just convert them to regular const variables with internal (static)
    linkage.
    
    The internal linkage bit is important: as long as they are invisible
    outside their respective translation units, we do not risk the static
    initialization order fiasco.  If we ever need to reference them outside
    their translation units, we would need to hide them behind functions (like
    HeapArrayDisposer::instance()) to keep things safe.
    2e7ece6b
schema-parser.c++ 15.3 KB