Hi Barry,
Sorry about the delay on this one - you managed to slip it past my sophisticated radar by posting two messages on the same date. (Apparently my radar was tuned to spotting either a single message, or the dozen or so which is typical for some hyperactive correspondents on this forum!)
And thank you for the bug report. It's probably not a common case (of specifying a starting search position which is beyond the end of the string), but it was a nasty bug that needed to be fixed.
It got introduced in 5.0.989 when I "optimized" the instr() operation for the simplest and most common case of a one character key. The problem was that the standard library routine I used - memchr() - treats the length argument as unsigned, but in the case you present, I was passing it a negative number, causing it to potentially search through a lot of memory. The case you presented was actually a near best case, since by chance, the string args are arranged on the stack so that the key follows the search string, and thus it was quickly found. (If you had set the starting position to 3 instead of 2, you'd get a surprising and unpredictable result.)
It is fixed in 5.0.994.2, which I'll post in the various forms shortly. (You'll be able to retrieve them via the Update Center or directly from the
http://www.microsabio.net/dist/50rel directories for each platform.)