Patent ID: 9734039
Date: 2017-08-15
CPC Classifications: G06F

Claim:
1. A method for providing input source codes with stack overflow protection, comprising: dividing, by a computing device, at time of compilation, at least one function in the input source codes into a code region with a string operation and a code region without a string operation; dividing said code region with a string operation into a high frequency code region and a low frequency code region based on execution frequencies of the code regions; and setting up, the computing device, stack protection in the code region with the string operation based upon the code region of the at least one function having the string operation, wherein the stack protection unit is further configured to exclude stack protection in the code region without the string operation based upon the code region of the at least one function lacking the string operation, wherein said stack protection unit is further configured to set up stack protection in said low frequency code region, wherein the execution frequency of said low frequency code region is less than a predetermined threshold, and wherein said predetermined threshold is determined based on statistic data of the execution frequency of said low frequency code regions.