mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #2417 from jbj/enclosing-reeval
C++: Prevent cached stages from being re-evaluated
This commit is contained in:
@@ -13,6 +13,11 @@ Element stmtEnclosingElement(Stmt s) {
|
||||
/**
|
||||
* Gets the enclosing element of expression `e`.
|
||||
*/
|
||||
// The `pragma[nomagic]` is a workaround to prevent this cached stage (and all
|
||||
// subsequent stages) from being evaluated twice. See QL-888. It has the effect
|
||||
// of making the `Conversion` class predicate get the same optimization in all
|
||||
// queries.
|
||||
pragma[nomagic]
|
||||
cached
|
||||
Element exprEnclosingElement(Expr e) {
|
||||
result = exprEnclosingElement(e.getParent())
|
||||
|
||||
Reference in New Issue
Block a user