You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I debugged 3C/prototype_success2.c, which is oddly compiled when you run the 3C\prototype_success1.c test. The 3C failure is due to trying to get a source location for a compiler-generated variable declaration. The test case that triggers the failures shows the problem:
_Ptr<int> foo(int *, char);
In the prototype declaration, only the types of the arguments are declared. The compiler generates a variable declaration. When 3C tries to fetch the source code location, an assert happens.
Here's a partial call stack. This is on Windows using the VS Studio debugger:
> 3c.exe!HandleAbort(int Sig) Line 415 C++
[External Code]
3c.exe!clang::SourceManager::getFileIDLoaded(unsigned int SLocOffset) Line 868 C++
3c.exe!clang::SourceManager::getFileIDSlow(unsigned int SLocOffset) Line 779 C++
3c.exe!clang::SourceManager::getFileID(unsigned int SLocOffset) Line 1831 C++
3c.exe!clang::SourceManager::getFileID(clang::SourceLocation SpellingLoc) Line 1120 C++
3c.exe!clang::SourceManager::getExpansionLocSlowCase(clang::SourceLocation Loc) Line 946 C++
3c.exe!clang::SourceManager::getExpansionLoc(clang::SourceLocation Loc) Line 1172 C++
3c.exe!PersistentSourceLoc::mkPSL(clang::SourceRange SR, clang::SourceLocation SL, const clang::ASTContext & Context) Line 61 C++
3c.exe!PersistentSourceLoc::mkPSL(const clang::Decl * D, const clang::ASTContext & C) Line 26 C++
3c.exe!MappingVisitor::VisitDecl(clang::Decl * D) Line 18 C++
3c.exe!clang::RecursiveASTVisitor<MappingVisitor>::WalkUpFromDecl(clang::Decl * D) Line 440 C++
3c.exe!clang::RecursiveASTVisitor<MappingVisitor>::WalkUpFromNamedDecl(clang::NamedDecl * D) Line 107 C++
The text was updated successfully, but these errors were encountered:
I cloned this repo's branch 17-init-main and tried running the 3C tests. I am only getting two tests which are failing. Can you post the commit on which you got the above results? Also, it looked like this repo is missing a change to the CMakeLists.txt from the 17-init-main branch of the archived fork. So I used the archive during my building. Please let me know if I should be building differently.
Thanks for pointing out there was an issue with the checkedc repo. It didn't have the 17-init-main branch from the archive. I have pushed that branch to the checkedc repo. I merged the most recent changes from main into the 17-init-main branch also.
For the 3C tests, I did a debug build on x64 Windows. I used this cmake command:
It could be the type of build or that platform that is causing the difference. Note that running checked-clang with a debug build is quite slow. It takes over an hour on my test system.
With this PR, there are 6 failing 3C test cases:
I debugged
3C/prototype_success2.c
, which is oddly compiled when you run the3C\prototype_success1.c
test. The 3C failure is due to trying to get a source location for a compiler-generated variable declaration. The test case that triggers the failures shows the problem:In the prototype declaration, only the types of the arguments are declared. The compiler generates a variable declaration. When 3C tries to fetch the source code location, an assert happens.
Here's a partial call stack. This is on Windows using the VS Studio debugger:
The text was updated successfully, but these errors were encountered: