[clang] [Clang][Interp] Fix the location of uninitialized base warning (PR #100761)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 26 22:09:16 PDT 2024
https://github.com/tbaederr commented:
![Screenshot from 2024-07-27 07-04-02](https://github.com/user-attachments/assets/5a7c4b26-2c68-4bb1-8480-4b7ff9e4be87)
The three regressions all have similar stack traces:
```
#5 0x000000000bba9f4c clang::Redeclarable<clang::TagDecl>::getFirstDecl() /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/Redeclarable.h:216:38
#6 0x000000000bba9cd5 clang::Redeclarable<clang::TagDecl>::getMostRecentDecl() /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/Redeclarable.h:227:12
#7 0x000000000bba9a69 clang::RecordDecl::getMostRecentDecl() /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/Decl.h:4168:59
#8 0x000000000bba99b5 clang::CXXRecordDecl::getMostRecentDecl() /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/DeclCXX.h:542:46
#9 0x000000000bba9995 clang::CXXRecordDecl::getMostRecentDecl() const /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/DeclCXX.h:546:5
#10 0x000000000bba9969 clang::CXXRecordDecl::dataPtr() const /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/DeclCXX.h:458:5
#11 0x000000000bba9885 clang::CXXRecordDecl::data() const /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/DeclCXX.h:463:11
#12 0x000000000bc92be5 clang::CXXRecordDecl::bases_begin() const /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/DeclCXX.h:627:58
#13 0x000000000bc7a6a9 clang::CXXRecordDecl::bases() const /home/fedora/interp-tests/llvm-project/clang/include/clang/AST/DeclCXX.h:623:35
#14 0x00000000127e9d9f clang::interp::CheckFieldsInitialized(clang::interp::InterpState&, clang::SourceLocation, clang::interp::Pointer const&, clang::interp::Record const*) /home/fedora/interp-tests/llvm-project/clang/lib/AST/Interp/EvaluationResult.cpp:127:41
```
So I think it's cases where the decl is no CXXRecordDecl.
This patch also drops the handling where the pointer descriptor was created for an expression - this might be relevant for those tests or not.
https://github.com/llvm/llvm-project/pull/100761
More information about the cfe-commits
mailing list