From time to time I will have a "one by one" error, for example:
unsigned int* x = calloc(2000, sizeof(unsigned int)); printf("%d", x[2000]);
I went beyond the selection, so I get an EXC_BAD_ACCESS signal at runtime. My question is: how is this detected? It seems like it will just silently return the garbage, since I'm only one byte, and not, say, a full page. What part of the system is stopping me from simply returning the garbage drum to x + 2000
?
source share