Re: Strange machine-level exception
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Jun 18, 2007
- 574 views
I just peeked at the code in be_runtime.c. I haven't coded in C for a couple years, yet something looks wrong to me - but again, *I* might be quite wrong just as well. Line 4654 says: "bv = *(++bp);", assuming ++bp can be read always. If the end of the sequence is being reached, one would expect *(++bp) to be NOVALUE. Aren't there cases (under Windows) where this might not be true, resulting in a bad read ptr error? Or perhaps it is Windows that catches the error and DOS/Linux don't care. Additionally, I wondered, reading lines 4633-4638, whether else if (bv == NOVALUE) { break; } else if (compare(a, bv) == 0) { /* not INT-INT case */ return bp - (object_ptr)b->base; } shouldn't read else { if (bv == NOVALUE) break; else if (compare(a, bv) == 0) /* not INT-INT case */ return bp - (object_ptr)b->base; } instead. Perhaps the two are equivalent, but at least the logic is clearer in the second form. CChris