Array Boundary Checking and No Error on Map Not Found
Displaying 1-3 of 3 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Overkill

I've been meaning to report this a long time ago, I just keep on forgetting. Trying to access or modify negative array indices doesn't raise an array bounds error. It instead accesses another region of memory, probably another array variable that's allocated.

Also, loading a map that doesn't exist, doesn't seem to raise an error, or at least map("") doesn't. It just exits Verge without any explanation or crash.

Segment from a Verge Wars log of something me and ustor are testing:

Determining Map To Load
MapSelection = -1
LocalMapIndex = -1
Map Index Found
Closing Save File
Save File Closed
Loading .map File: ()

Posted on 2005-11-18 17:45:43

Overkill

Come on! How hard could it be to check if (arrayindex < 0) in the boundary detection code, or also give an error message when you map("")? ;__;

Posted on 2005-11-29 06:20:21

Jesse

1. There is no general array boundary detection code. Moreover, there are at least a dozen places where negative indexes of built-in arrays are ignored, rather than error-ed. Ditto for indexes greater than permitted. Changing this to be consistent would probably break existing code, so it's not just something one can throw in there without thought.

2. There is specific code to check for map("") and quit verge quietly. This would be easy to change, but clearly someone thought it was a good idea at some point.

I, for one, am quiet busy. Neither would be hard, but neither is obviously a good idea, either. Make (separate!) bug reports for them, and let the maintenance programmers take a look at 'em after the source release.

Posted on 2005-11-29 10:15:04


Displaying 1-3 of 3 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.