================ @@ -9896,9 +9903,13 @@ Expected<FileID> ASTImporter::Import(FileID FromID, bool IsBuiltin) { // FIXME: The filename may be a virtual name that does probably not // point to a valid file and we get no Entry here. In this case try with // the memory buffer below. - if (Entry) + if (Entry) { + if (isBufferSizeOverflow(ToSM, Entry->getSize())) + return llvm::make_error<ASTImportError>( + ASTImportError::UnsupportedConstruct); ---------------- balazske wrote:
This error is clearly not an unsupported AST construct. For this case a new error type should be added like `ASTImportError::SourceLocationOverflow` or `ResourceOverflow`. Code in `CrossTranslationUnitContext::importDefinitionImpl` should be updated to count this new error. Alternatively the `llvm_unreachable` from `UnknownError` can be removed. But `UnknownError` should be used if something happens that is not supposed to happen, even if now it is used like "other error". https://github.com/llvm/llvm-project/pull/79084 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits