Patent ID: 11880688
Assignee: GOOGLE LLC
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 14:
15. A computing device comprising:
at least one processor; and
at least one computer-readable storage media device comprising instructions that, when executed by the at least one processor, cause the processor to:
receive a function, the function comprising:
function instructions;
a plurality of basic blocks comprising respective portions of the function instructions; and
at least two execution paths between a first basic block and a second basic block of the plurality of basic blocks;

establish a hash function, the hash function used to compute respective hash values at executed-instruction states of the function instructions;
insert a reset-hash instruction within the first basic block, the reset-hash instruction setting a hash value at an executed-instruction state of the reset-hash instruction to an initial hash-value;
select a target executed-instruction state within the second basic block;
insert a check-hash instruction at the target executed-instruction state, the check-hash instruction comparing a hash value at the target executed-instruction state to an expected hash-value at the target executed-instruction state;
insert respective hash-input instructions within each of the plurality of basic blocks other than the second basic block, the hash-input instructions setting respective hash input-values to the hash function for computing hash values at executed-instruction states of the hash-input instructions;
determine the expected hash-value at the target executed-instruction state and the hash input-values for the hash-input instructions based on the initial hash-value, a canonical value, and the hash function; and
form a compiled function including:
the function instructions;
the reset-hash instruction with the initial hash-value;
the hash-input instructions with the corresponding hash input-values; and
the check-hash instruction with the expected hash-value at the target executed-instruction state.