A memory device is provided that is used by a computer system and that has a
memory
pattern obtained after a function is called when the computer system executes a
program, the memory pattern comprising: a return address storage area for storing
a return address 230 for the source of a call for the execution of a currently
active function; a previous frame pointer storage area for storing a previous frame
pointer 220 to the calling source for the execution of a currently active
function; and a local variable storage area to be located below the return address
storage area 230 and the previous frame pointer storage area 22,
wherein when a data array 211 is stored in the local variable area, a guard
variable 212 is stored in a location preceding the data array 211,
and wherein the guard variable is used as a target to confirm whether the return
address has been destroyed.