A method of securing a compiled software code (SC) comprising computer code instructions organized in a plurality of basic blocks, said method generating a secure software code (SSC) and comprising the steps of : • determining (S1) by a processor a portion of the software code to be protected, • inserting (S2) by the processor in a selected basic block of the software code a first sequence of instructions which when executed at runtime: ▪ computes (E1) an integrity check value on said portion of the software code to be protected, ▪ computes (E2) an index value based on said computed integrity check value, • inserting (S3) 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 (S4) 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 (S5) 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 (S6) 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 (S5), • setting in the array the address of the following basic block at said index value computed in the fifth securing step. • determining (S1) by a processor a portion of the software code to be protected, • inserting (S2) by the processor in a selected basic block of the software code a first sequence of instructions which when executed at runtime: ▪ computes (E1) an integrity check value on said portion of the software code to be protected, ▪ computes (E2) an index value based on said computed integrity check value, ▪ computes (E1) an integrity check value on said portion of the software code to be protected, ▪ computes (E2) an index value based on said computed integrity check value, • inserting (S3) 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 (S4) 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 (S5), • setting in the array the address of the following basic block at said index value computed in the fifth securing step. <EOS>