oakc icon indicating copy to clipboard operation
oakc copied to clipboard

Dereferenced non-allocated pointer error

Open adam-mcdaniel opened this issue 5 years ago • 1 comments
trafficstars

To make programs more correct, runtime checks could be added for determining whether or not the program is accessing memory it does not own.

To be a valid pointer, it must either:

  1. Point to an address that is less than the stack pointer. Pointers to stack variables are valid pointers.
  2. Point to allocated memory on the heap. Non-allocated memory on the heap should not be accessed.

Dereferencing an address that violates either of those rules could throw a accessed unowned memory error.

adam-mcdaniel avatar Aug 24 '20 21:08 adam-mcdaniel

Does this mean that every dereference of a pointer has to be checked? I'm assuming performance is not really a concern right now, but does this not generate a lot of overhead?

kevinramharak avatar Aug 25 '20 20:08 kevinramharak