TALibraryInCSharp icon indicating copy to clipboard operation
TALibraryInCSharp copied to clipboard

Minus DM infinite loop

Open Skyller00 opened this issue 6 years ago • 2 comments

Label_0186 infinite loop.

Skyller00 avatar Apr 04 '18 15:04 Skyller00

What is the error you are getting?

Looking at the code (see code below) I do not see where it could choke(seem like an infinite loop) unless you are entering a number for optInTimePeriod (method parameter) that is in the really high, the max is 0x186a0 (int 100,000). optInTimePeriod should never go above 100 or so, The default is 14.

// relevant code segments

if ((optInTimePeriod < 1) || (optInTimePeriod > 0x186a0)) // fails if negative or greater than 100,000 { return RetCode.BadParam; } ... int i = optInTimePeriod - 1; // setting i here based on optInTimePeriod ... i = (int)Globals.unstablePeriod[0x10]; // equals 16, might be 15 Label_0186: i--; // reduced i each loop if (i != 0) { .... goto Label_0186; }

DavidFuchs42 avatar Apr 04 '18 21:04 DavidFuchs42

Do not know how but the line: i = (int)Globals.unstablePeriod[0x10]; Set the value of i to 0

Skyller00 avatar Apr 10 '18 16:04 Skyller00