[sword-devel] Odd behavior in ListKey

DM Smith dmsmith at crosswire.org
Sun Jun 15 08:11:09 EDT 2025


Troy,

I’ve narrowed it down to turning Auto Normalize off.

In examples/cmdline/parseverselist.cpp, add parser.setAutoNormalize(false) to see the error with Gen.51.1. Note Gen.50.99 (last chapter with bad verse number) works.

DM

> On Jun 12, 2025, at 7:03 PM, DM Smith <dmsmith at crosswire.org> wrote:
> 
> Troy,
> 
> I’m working on an infinite loop bug in osis2mod.
> 
> I’ve narrowed it down to ListKey containing a verse with a chapter which is beyond the end of a book.
> 
> When this happens list.increment(1) never sets an error.
> 
> Simplest test case (bit incomplete):
> 
> int i = 0;
> ListKey list = new ListKey();
> list.add(“Gen.51.1”);
> for (list = TOP; !list.popError(); list.increment(1)) {
> 	if (i++ > 5) break;
> 	cout << i << list << endl;
> }
> 
> If I change the verse reference to Gen.1.99 (valid chapter, invalid verse), it works as expected.
> 
> Can you figure out the problem?
> 
> I’ve got a work around but I’d rather not do that.
> 
> Thanks,
> 	DM
> 
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page



More information about the sword-devel mailing list