A program to be executed by a computer is divided into a plurality of code
blocks, and, a unique code block ID is allotted to each code block. At
the moment when the execution of the program is started, the code block
ID corresponding to the execution start address is written in a memory,
and in the case when the control transits from the code block to other
code block, by use of code block operation values obtained beforehand
from these two code block IDs thereof, the code block ID in the memory is
updated, and it is judged whether the updated code block ID in the memory
and the code block ID allotted to the code block as the execution
objective are identical or not so that a control flow error is detected.