Skip to content

A non defined function macro being used results in a crash #222

Description

@ThadHouse
#define ADDRESS_IN_USE TESTRESULT_FROM_WIN32(10048)

If TESTRESULT_FROM_WIN32 is not defined, the above code will result in the following stack trace.

System.InvalidCastException
  HResult=0x80004002
  Message=Unable to cast object of type 'ClangSharp.Stmt' to type 'ClangSharp.Expr'.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Runtime.CompilerServices.CastHelpers.ChkCastAny(Void* toTypeHnd, Object obj)
   at ClangSharp.TranslationUnit.GetOrCreate[TCursor](CXCursor handle) in C:\Users\thhous\Documents\GitHub\ClangSharp\sources\ClangSharp\TranslationUnit.cs:line 105
   at ClangSharp.VarDecl.<>c__DisplayClass4_0.<.ctor>b__1() in C:\Users\thhous\Documents\GitHub\ClangSharp\sources\ClangSharp\Cursors\Decls\VarDecl.cs:line 26
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions