illegal one-byte branch

Sep 25, 2008 at 9:15 PM
I'm still seeing this problem using 0.9.18.0.  Deeply-nested IFs seems to be a problem, although even a depth of three is tanking.

Here's one example (formatted for clarity):

IF(
    MovementType = \"C\",
    RailFee * XctnQty ,
    IF(
        MovementType = \"P\",
        PipeFee * XctnQty ,
        IF(
            MovementType = \"R\",
            TruckFee * XctnQty ,
            IF(
                MovementType = \"V\",
                VesselFee * XctnQty ,
                InFacilityFee * XctnQty
            )
        )
    )
)

Here's the stack trace:

at System.Reflection.Emit.ILGenerator.BakeByteArray()
at System.Reflection.Emit.DynamicResolver..ctor(DynamicILGenerator ilGenerator)
at System.Reflection.Emit.DynamicILGenerator.GetCallableMethod(Void* module)
at System.Reflection.Emit.DynamicMethod.GetMethodDescriptor()
at System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType)
at Ciloci.Flee.Expression`1.Compile(String expression, Object owner, ExpressionOptions options)
at Ciloci.Flee.Expression`1..ctor(String expression, ExpressionContext context)
at Ciloci.Flee.ExpressionFactory.CreateDynamic(String expression, ExpressionContext context)
at [my code]

Any thoughts?
Nov 9, 2008 at 10:27 PM
Edited Nov 9, 2008 at 10:31 PM
This should be fixed in 0.9.19.0
Nov 9, 2008 at 11:45 PM
Edited Nov 9, 2008 at 11:48 PM
<deleted by author>
Nov 9, 2008 at 11:46 PM
Edited Nov 9, 2008 at 11:48 PM
<deleted by author>