The application provides a memory defect static detection method based on a type region model, first, function call graphs and
control flow graphs of a program to be detected are obtained through front-end
processing; then, a type region model is constructed based on the function call graphs and the
control flow graphs,
static analysis is carried out, and the model and the program state are updated after the analysis; and then, according to defect behaviors that can occur at a current program point and program state information carried by the
static analysis, a detection process of a certain defect type is entered. Through the memory defect detection method based on the type region model, the application can accurately describe the state of the program, ensure the
correctness of data flow information at most program points, can analyze deeper reasons for the occurrence of
memory defects in detail, and designs corresponding defect detection rules to ensure sufficient detection of the defects and reduce false negatives and false positives.