首页 | 官方网站   微博 | 高级检索  
     

C/C++源代码静态检测系统的设计和实现
引用本文:饶坤,彭四伟.C/C++源代码静态检测系统的设计和实现[J].电子设计工程,2011,19(12):28-31.
作者姓名:饶坤  彭四伟
作者单位:北京化工大学信息学院,北京,100029
摘    要:为了检测出C/C++源代码程序中常见的运行时错误,设计了一个静态检测系统。该系统通过词法分析、语法分析、语义分析来获取程序的语法树。然后系统的检测程序将会分析语法树的每一个结点,判断结点中的属性信息是否存在错误。创新点在于语法树数据结构和检测程序的设计。通过检测程序对结点的属性值的分析,能够检测出C/C++源代码程序中出现的数组越界、指针错误、字符串函数错误,内存泄露等问题。

关 键 词:数组越界  存储越界  内存泄露  语法树

Design and implementation of the static detection system of C/C++ source codes
RAO Kun,PENG Si-wei.Design and implementation of the static detection system of C/C++ source codes[J].Electronic Design Engineering,2011,19(12):28-31.
Authors:RAO Kun  PENG Si-wei
Affiliation:(Information Institute,Beijing University of Chemical Technology,Beijing 100029,China)
Abstract:A static detection system is designed in order to detect C/C++ source codes that probably have several runtime errors.This system will change the source code into an AST through lexical analysis,syntax analysis and semantic analysis,and then the system will check every node of the AST and judge whether there are errors in the nodes.The innovation points are the design of AST date structure and checking program.With checking program’s analysis to the values of nodes,it could find out some runtime errors such as array out of bound,storage overflow,memory leak and function errors.
Keywords:array out of bound  memory leak  storage overflow  AST
本文献已被 CNKI 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号