mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Improve docs of LiveLiteral
Also remove transitive closure from calls
This commit is contained in:
committed by
Ian Lynagh
parent
3836d1550a
commit
bc84ff2031
@@ -14,10 +14,19 @@ class LiveLiteral extends MethodAccess {
|
||||
not this.getEnclosingCallable() instanceof LiveLiteralMethod
|
||||
}
|
||||
|
||||
/** Gets the constant value that backs this live literal. */
|
||||
/**
|
||||
* Live literal classes consist of the following:
|
||||
* - A private field holding the constant value that backs this live literal.
|
||||
* - A private getter to access the constant value.
|
||||
* - A public getter that either calls the private getter and returns its result or,
|
||||
* if live literals are activated, returns the value of a dynamic state object that is initialized with
|
||||
* the constant value.
|
||||
*
|
||||
* This predicate gets the constant value held by the private field.
|
||||
*/
|
||||
CompileTimeConstantExpr getValue() {
|
||||
result =
|
||||
any(ReturnStmt r | this.getMethod().calls*(r.getEnclosingCallable()))
|
||||
any(ReturnStmt r | this.getMethod().calls(r.getEnclosingCallable()))
|
||||
.getResult()
|
||||
.(VarAccess)
|
||||
.getVariable()
|
||||
|
||||
Reference in New Issue
Block a user