指针的安全性是C语言程序中的常见问题,它严重影响到系统的安全性.针对指针静态分析中的精度问题,比较分析了目前常见的5种指针分析算法的优缺点,提出了一种基于流不敏感的改进指针静态分析算法.该算法是在Steensgaard算法的基础上,对程序的控制流图进行改进,通过该算法可以得到比常见的数据流不敏感算法更为精确的指针分析结果.在实验室开发的国内首款商用编译器中实现了该算法,实验结果表明该算法可以提高指针分析的精度.
The safety of pointer is quite common in C programs,which affects the safety of a system enormously.The paper focuses the precision of the pointer static analysis,and presents an analysis of the current algorithms,and then proposes an improved pointer static analysis algorithm.Based on the Steensgaard algorithm,the control flow graph is improved,through which a more precise result of pointer analysis is obtained.The result is more precise than the current flow-insensitive pointer analysis.The algorithm is implemented in the compiler,which is the first commercial compiler developed in our lab.The results indicate that the algorithm can improve the precision of pointer analysis.