mirror of
https://github.com/github/codeql.git
synced 2026-03-04 22:56:47 +01:00
This change moves the simple constant analysis that was used by the const_func test into a pyrameterized module for use on any stage of the IR. This will be used to detect unreachable code.
10 lines
347 B
Plaintext
10 lines
347 B
Plaintext
import default
|
|
import semmle.code.cpp.ir.IR
|
|
import semmle.code.cpp.ir.implementation.aliased_ssa.constant.ConstantAnalysis
|
|
import semmle.code.cpp.ir.internal.IntegerConstant
|
|
|
|
from FunctionIR funcIR, int value
|
|
where
|
|
value = getValue(getConstantValue(funcIR.getReturnInstruction().(ReturnValueInstruction).getReturnValue()))
|
|
select funcIR, value
|