
Originally Posted by
CuriousOne
Well, that is interesting.
As I understand, there is no "index out of bounds" error type supported by PBP?
Page 275 of the manual:
7.6.1 The Danger
The techniques about to be discussed are not monitored by PBP during compilation
or execution of the program. This means that you can write some crazy code that
could totally wreck the RAM on the PIC MCU. PBP won't warn you or generate an
error message.
The greatest opportunity for trouble lies in the fact that PBP doesn't monitor (isn't
even aware) of array variable sizes. When you declare an array in PBP and specify
a size, all that really happens is that PBP skips a number of RAM locations after the
base variable name is allocated.
Code:
my_array VAR WORD[16] ' Allocates "my_array" as two
bytes, then skips (reserves) a
block of 30 bytes in RAM
Even if you blatantly write to a location that is beyond the size of an array you created,
PBP won't complain.
Bookmarks