Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Clone code detection method based on llvm

A code detection and code technology, applied in the field of LLVM-based clone code detection, can solve problems such as security risks

Active Publication Date: 2020-11-13
NANJING UNIV OF POSTS & TELECOMM
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] While cloning code improves production efficiency, it also brings huge security risks

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Clone code detection method based on llvm
  • Clone code detection method based on llvm
  • Clone code detection method based on llvm

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0064] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0065] A kind of clone code detection method based on LLVM that present embodiment introduces, comprises preprocessing step, merges mapping step, extracts fragmentation step, matching step, summary result step, concrete steps are as follows:

[0066] Step 1) Preprocessing steps:

[0067] Step 1.1) LLVM converts the C source code into the LLVM IR instruction set. In addition to C language, other languages ​​can be easily converted as long as there is a corresponding front end;

[0068] Step 1.2) Relying on the existing LLVM IR code slicing tool, obtain the program dependency graph of the LLVM IR l...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides an LLVM (low level virtual machine)-based cloning code detection method. The LLVM-based cloning code detection method includes a pre-processing step, a combined mapping step, afragment extracting step, a matching step and a summarizing step. According to the method, source codes are pre-processed, the front end approved by a source program is converted into an intermediatelanguage, the converted program is subjected to program sharding, and dependency between intermediate sentences is acquired to further acquire a dependency map of an LLVM IR language; acquired data are further processed to acquire a minimal statement relationship set; the statement relationship set is divided according to a division method, and cloning codes are acquired according to a distributedcomparison method. The LLVM-based cloning code detection method has the advantages that relationship set samples are acquired according to trimming results, and statement characteristics are maintained; matching accuracy in code detection is improved; through extra characteristics brought by the LLVM IR intermediate language and based on multiple matching modes, matching methods are enriched, andbetter cloning code detection is realized.

Description

technical field [0001] The invention relates to the technical field of software analysis, in particular to an LLVM-based clone code detection method. Background technique [0002] With the rapid development of software, all kinds of software users have become a huge group, and software is penetrating into every aspect of people's lives. Nowadays, many developers publish the software source code on the open Internet, and other developers can generally refer to the open source code related to learning, and this phenomenon has become a common production method today. [0003] While cloning code improves production efficiency, it also brings huge security risks. Code clone detection is needed in many projects. For example, in terms of version updates, two versions can be compared through clone code detection. Code clone detection allows developers to better understand code replacement, greatly Improve the efficiency of code modification; In terms of testing code, in order to i...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/75G06F11/36
CPCG06F8/751G06F11/3608
Inventor 张迎周陈星昊王星尹秀赵莲
Owner NANJING UNIV OF POSTS & TELECOMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products