Skip to content
New issue

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

Null Reference Exception during generation in PInvokeGenerator.cs#L2960 #580

Open
JustArion opened this issue Nov 29, 2024 · 0 comments
Open

Comments

@JustArion
Copy link

sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs#L2960

While generating from extension.h a null reference exception is thrown.

ClangSharpArgs.rsp

--additional
-m64
--config
generate-tests-nunit
multi-file
-std
c++20
--include-directory
_\modengine2\include
--file-directory
_\modengine2\include\modengine
--file
extension.h
--namespace
ModEngine.Bindings
--output
./Bindings
--test-output
./ClangArtifacts
--methodClassName
Interop
--with-librarypath
*=ModEngine2

_ paths omitted for brevity

Stack Trace

\modengine2\include\modengine\extension.h:
    Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at ClangSharp.PInvokeGenerator.<GetCursorQualifiedName>g__AppendTemplateArgument|79_2(TemplateArgument templateArgument, StringBuilder qualifiedName) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 2960
   at ClangSharp.PInvokeGenerator.<GetCursorQualifiedName>g__AppendTemplateArguments|79_3(ClassTemplateSpecializationDecl classTemplateSpecializationDecl, StringBuilder qualifiedName, <>c__DisplayClass79_0&) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 3001
   at ClangSharp.PInvokeGenerator.GetCursorQualifiedName(NamedDecl namedDecl, Boolean truncateParameters) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 2893
   at ClangSharp.PInvokeGenerator.<VisitTypedefDecl>g__ForUnderlyingType|191_2(TypedefDecl typedefDecl, Type underlyingType, Boolean onlyHandleRemappings) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs:line 3285
   at ClangSharp.PInvokeGenerator.VisitDecl(Decl decl) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs:line 38
   at ClangSharp.PInvokeGenerator.Visit(Cursor cursor) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 6698
   at ClangSharp.PInvokeGenerator.Visit(IEnumerable`1 cursors) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 6731
   at ClangSharp.PInvokeGenerator.VisitNamespaceDecl(NamespaceDecl namespaceDecl) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs:line 1179
   at ClangSharp.PInvokeGenerator.VisitDecl(Decl decl) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs:line 89
   at ClangSharp.PInvokeGenerator.Visit(Cursor cursor) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 6698
   at ClangSharp.PInvokeGenerator.Visit(IEnumerable`1 cursors) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 6731
   at ClangSharp.PInvokeGenerator.VisitTranslationUnitDecl(TranslationUnitDecl translationUnitDecl) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs:line 3195
   at ClangSharp.PInvokeGenerator.VisitDecl(Decl decl) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.VisitDecl.cs:line 258
   at ClangSharp.PInvokeGenerator.Visit(Cursor cursor) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 6698
   at ClangSharp.PInvokeGenerator.GenerateBindings(TranslationUnit translationUnit, String filePath, String[] clangCommandLineArgs, CXTranslationUnit_Flags translationFlags) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 1730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant