Ruby: Add post-update argument nodes for string constants

This commit is contained in:
Tom Hvitved
2024-03-15 10:14:47 +01:00
parent f464f1b94e
commit e7b00a7b42
6 changed files with 33 additions and 3 deletions

View File

@@ -322,7 +322,11 @@ private class Argument extends CfgNodes::ExprCfgNode {
/** Holds if `n` is not a constant expression. */
predicate isNonConstantExpr(CfgNodes::ExprCfgNode n) {
not exists(n.getConstantValue()) and
not exists(ConstantValue cv |
cv = n.getConstantValue() and
// strings are mutable in Ruby
not cv.isString(_)
) and
not n.getExpr() instanceof ConstantAccess
}