System.AccessViolationException when mapping using Mapster
Alex-Dobrynin opened this issue · 1 comments
Alex-Dobrynin commented
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
repro project:
ConsoleApp1.zip
If look at generated c# string, then you can see that there is strange variable with name datetime?__{somenumber}, which has type DateTime?
dadhi commented
@Alex-Dobrynin
Thanks for the example.
Looking quickly at the code, the problem probably around the DateTime
or DateTimeOffset
mapping and the nested lambda invocation.
I have found that using the flag var del = exp.CompileFast(flags: CompilerFlags.NoInvocationLambdaInlining);
work-arounds the problem.
So you may try it out until the problem is fixed.