[clang] [clang-repl] fix error recovery while parsing completely fails (PR #127087)
Abhinav Kumar via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 18 09:21:18 PST 2025
kr-2003 wrote:
> My theory with limited testing: The crash is caused by assertion failure at https://github.com/llvm/llvm-project/blob/eb7c947272952d40d3235d89652a10da52cb2b4d/clang/lib/AST/DeclBase.cpp#L1757C1-L1758C54. So if we disable assertions it does not crash, and crashes otherwise. Maybe you can confirm this. There is a flaw in the logic of recovering from syntax/semantic errors.
Even without removing those assertions, the malformed try-catch block gave parsing error successfully if we build it with the following flags.
```-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_PROJECTS=clang -DLLVM_USE_SPLIT_DWARF=ON -DLLVM_USE_LINKER=lld```
https://github.com/llvm/llvm-project/pull/127087
More information about the cfe-commits
mailing list