5
Vote

ArgumentOutOfRangeException in Ciloci.Flee.BranchManager.IsLongBranch()

description

Message: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index.
 
Stack trace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List1.get_Item(Int32 index)
at Ciloci.Flee.BranchManager.IsLongBranch(FleeILGenerator ilg, Label target)
at Ciloci.Flee.ConditionalElement.EmitConditional(FleeILGenerator ilg, IServiceProvider services, BranchManager bm)
at Ciloci.Flee.ConditionalElement.Emit(FleeILGenerator ilg, IServiceProvider services)
at Ciloci.Flee.RootExpressionElement.Emit(FleeILGenerator ilg, IServiceProvider services)
at Ciloci.Flee.Expression
1.Compile(String expression, ExpressionOptions options)
at Ciloci.Flee.Expression`1..ctor(String expression, ExpressionContext context, Boolean isGeneric)
at Ciloci.Flee.ExpressionContext.CompileDynamic(String expression)
at [my code]
 
Expression being evaluated:
 
If( XctnHdrID = TaxLoadXHdrID ,If( TaxLoadProduct = TaxLoadProductGroup , If( TaxLoadQuantity > FromQuantity and TaxLoadQuantity <= ToQuantity , FlatFixed - ((Round( FlatFixed / TaxLoadXHdrCount, 2)) * ( TaxLoadXHdrCount-1)) , NoValue ) , If( TaxLoadQuantity > FromQuantity2 and TaxLoadQuantity <= ToQuantity2 , FlatFixed2 - ((Round(FlatFixed2 / TaxLoadXHdrCount,2)) * (TaxLoadXHdrCount-1)), NoValue) ), If(TaxLoadProduct = TaxLoadProductGroup , If( TaxLoadQuantity > FromQuantity and TaxLoadQuantity <= ToQuantity , FlatFixed / TaxLoadXHdrCount, NoValue ) , If( TaxLoadQuantity > FromQuantity2 and TaxLoadQuantity <= ToQuantity2 , FlatFixed2 / TaxLoadXHdrCount, NoValue ) ))
 
Round() is implemented as a simple wrapper for Math.Round().
 
A fix, obviously, would be ideal, but a workaround would also be helpful. I can easily replicate this, so let me know if you need any other info.

file attachments

comments

tlibasci wrote Dec 23, 2009 at 4:53 PM

This is in 0.9.26.0.

wrote Apr 7, 2010 at 3:57 AM

wrote Nov 27, 2010 at 10:07 AM

ashkulz wrote Nov 27, 2010 at 10:07 AM

Here's a patch which will fix this issue, it defaults to creating a long branch instead of throwing an exception.

wrote May 17, 2011 at 3:57 PM

wrote Jun 20, 2012 at 10:20 PM

wrote Feb 21, 2013 at 11:54 PM

AndyStewart wrote Dec 8, 2013 at 5:10 PM

Hi

I'm having this same issue, has this patch been applied to the main source and is there any reason why I shouldn't use it? I'd rather not build my own fork if I can get just get the latest from the source tree.

Thanks

Andy

ashkulz wrote Dec 9, 2013 at 6:59 AM

I've been using FLEE with this patch in production for a few years -- the FLEE developer is missing since late 2009, but it is mostly stable. Someone should fork it and apply all the patches, but I guess no one ever did it till now :-)

wrote Dec 13, 2013 at 10:33 AM