-
-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Description
Hi!
I've added a failing test to the issues project in PR #150 where a fast-compiled Func is throwing 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt'.
The compiled lambda is:
dsosToPpssData =>
{
var publicPropertyStruct_String = dsosToPpssData.Target;
string valueKey;
object value;
publicPropertyStruct_String.Value = ((valueKey = dsosToPpssData.Source.Keys.FirstOrDefault(key => key.MatchesKey("Value"))) != null)
? ((value = dsosToPpssData.Source[valueKey]) != null) ? value.ToString() : null
: null;
return publicPropertyStruct_String;
}
The error is not thrown if I use the FirstOrDefault()
overload that doesn't take a lambda. I note your source states nested lambdas are not supported, but it is a simple one and TryEmitNestedLambda
is there, so I figured you might want to take a look :)
Cheers,
Steve
dzmitry-lahoda