We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LambdaContextDecl
CXCursor
CXXRecordDecl
An assert raised in libClang. see: https://github.com/llvm/llvm-project/blob/ef4ffcafbb2deeb30ccc30ebcdf9a5a843a27ec1/clang/lib/AST/DeclCXX.cpp#L1534-L1538
If CXXRecordDecl::isLambda() is false an assert is caused, which somehow writes to invalid memory.
CXXRecordDecl::isLambda()
Check CXXRecordDecl::isLambda() before accessing CXXRecordDecl::getLambdaContextDecl()
CXXRecordDecl::getLambdaContextDecl()
CXCursor clangsharp_Cursor_getLambdaContextDecl(CXCursor C) { if (clang_isDeclaration(C.kind)) { const Decl* D = getCursorDecl(C); if (const CXXRecordDecl* CRD = dyn_cast<CXXRecordDecl>(D)) { if( CRD->isLambda() ) return MakeCXCursor(CRD->getLambdaContextDecl(), getCursorTU(C)); } } return clang_getNullCursor(); }
I've implemented the change and it fixed the problem.
https://github.com/microsoft/ClangSharp/blob/2e4f410e6c065a2e51b54889f202b61c3c4a5438/sources/libClangSharp/ClangSharp.cpp#L1690-L1700
The text was updated successfully, but these errors were encountered:
This was resolved in #185
Sorry, something went wrong.
No branches or pull requests
When the
LambdaContextDecl
property on aCXCursor
that represents aCXXRecordDecl
invalid memory might be accessedCause:
An assert raised in libClang.
see:
https://github.com/llvm/llvm-project/blob/ef4ffcafbb2deeb30ccc30ebcdf9a5a843a27ec1/clang/lib/AST/DeclCXX.cpp#L1534-L1538
If
CXXRecordDecl::isLambda()
is false an assert is caused, which somehow writes to invalid memory.Solution:
Check
CXXRecordDecl::isLambda()
before accessingCXXRecordDecl::getLambdaContextDecl()
I've implemented the change and it fixed the problem.
Source location:
https://github.com/microsoft/ClangSharp/blob/2e4f410e6c065a2e51b54889f202b61c3c4a5438/sources/libClangSharp/ClangSharp.cpp#L1690-L1700
The text was updated successfully, but these errors were encountered: