What is "Access Overrun"?

delphi package - automated exception handling
Post Reply
rodc
Posts: 10
Joined: Fri Mar 23, 2007 7:24 pm
Location: Porto Alegre - Brazil

What is "Access Overrun"?

Post by rodc »

The option "instantly crash on buffer ... overrun" on madexcept shouldn't catch this type of error? Or I didn't understood what is this option?

Code: Select all

int test[2];
test[3] = 20;  // isn't it an access overrun?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: What is "Access Overrun"?

Post by madshi »

It depends. If the array is *allocated* then such a type of error should be detected. However, it also depends on allocation alignment. Some code requires code to be aligned in a certain way. Because of that it's sometimes possible that I can't detect if you just overrun a buffer by a tiny amount (say just 1 byte or maybe 2-3 bytes), but it also depends on the exact size of the buffer.

Your code seems to use a local variable. Such variables are not allocated, they're instead placed on the stack by the compiler, which makes it technically impossible for me to detect an overrun.
Post Reply