Destroy RecursiveImportCacheRepository after PersistentSymbolTableRepo
a8ffba2c cleared the persistent symbol table caches in ~PersistentSymbolTable() to work around an AddressSanitizer crash when a non-empty imports cache is destroyed after the cache repository it references. The constructor of the PersistentSymbolTable singleton creates a PersistentSymbolTableRepo function-local static, then a RecursiveImportCacheRepository function-local static. The order of destruction of these 3 static objects is the reverse of the order of their construction completion: ~PersistentSymbolTable() recursiveImportCacheRepositoryObject's destruction ~PersistentSymbolTableRepo() Since PersistentSymbolTableRepo::importsCache depends on recursiveImportCacheRepositoryObject and not vice versa, a proper fix is to create the cache repository before and thus destroy after the persistent symbol table repository.
parent
17d3a563
Please register or sign in to comment