A method of securing a compiled software code comprising computer code instructions organized in a plurality of basic blocks, said method generating a secure software code and comprising the steps of: • determining by a processor a portion of the software code to be protected, • inserting by the processor in a selected basic block of the software code a first sequence of instructions which when executed at runtime: ▪ computes an integrity check value on said portion of the software code to be protected, ▪ computes an index value based on said computed integrity check value, • inserting by the processor in the selected basic block of the software code an indexed array of memory addresses in which the address, when executing the secure software code, of a following basic block to be executed after the selected basic block is indexed by said index value, • inserting by the processor at the end of the selected basic block of the software code a jump instruction to the address indexed in the array by said index value computed at runtime, said integrity check value being computed on instructions of the secure software code between a start address and a stop address, characterized by: said method comprising further a fifth securing step performed when or after compiling and linking the secure software code and comprising: • determining begin and end addresses in the software code of the beginning and end of a portion of the software code on which the integrity check value is to be computed, • computing said integrity check value and said index value based on said computed integrity check value, and comprising a sixth securing step performed when or after compiling and linking the secure software code and comprising: • setting said start and stop addresses to said begin and end addresses determined in the fifth securing step, • setting in the array the address of the following basic block at said index value computed in the fifth securing step. • determining by a processor a portion of the software code to be protected, • inserting by the processor in a selected basic block of the software code a first sequence of instructions which when executed at runtime: ▪ computes an integrity check value on said portion of the software code to be protected, ▪ computes an index value based on said computed integrity check value, ▪ computes an integrity check value on said portion of the software code to be protected, ▪ computes an index value based on said computed integrity check value, • inserting by the processor in the selected basic block of the software code an indexed array of memory addresses in which the address, when executing the secure software code, of a following basic block to be executed after the selected basic block is indexed by said index value, • inserting by the processor at the end of the selected basic block of the software code a jump instruction to the address indexed in the array by said index value computed at runtime, • determining begin and end addresses in the software code of the beginning and end of a portion of the software code on which the integrity check value is to be computed, • computing said integrity check value and said index value based on said computed integrity check value, • setting said start and stop addresses to said begin and end addresses determined in the fifth securing step, • setting in the array the address of the following basic block at said index value computed in the fifth securing step.