There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
EmitLiteral in Identifier.vb
if you have an expression accessing a value type field member and using the result in a further expression element which requires an address you run into an unhandled exception within the IL code, e.g.
MaxValue is a constant field of a value type and the ToString( ) will cause the exception in the IL code.
doesn't run into that problem, since the IL code generation is done in a different way (no field member).
How to fix that?
Change Identifier.vb in the following way
1) add a new parameter nextRequiresAddress As Boolean to Sub EmitLiteral like
Sub EmitLiteral(ByVal fi As System.Reflection.FieldInfo, ByVal ilg As FleeILGenerator, ByVal services As IServiceProvider, ByVal nextRequiresAddress As Boolean)
2) after code line elem.Emit(ilg, services) in Sub EmitLiteral add the following code
If nextRequiresAddress = True Then
3) change the EmitFieldLoad Sub where the EmitLiteral Sub is called like
EmitLiteral(fi, ilg, services, Me.NextRequiresAddress)
Many thanks to the author of Flee for this excellent library!
best regards grabul