File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
python/ql/src/semmle/python/functions Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,9 @@ module ModificationOfParameterWithDefault {
139139 boolean isInverted ( ) { result = inverted }
140140 }
141141
142+ /**
143+ * A check for the value being truthy or falsy can guard against modifying the default value.
144+ */
142145 class IdentityGuard extends BarrierGuard {
143146 ControlFlowNode checked_node ;
144147 boolean safe_branch ;
@@ -149,7 +152,7 @@ module ModificationOfParameterWithDefault {
149152 exists ( IdentityGuarded ig |
150153 this .getNode ( ) = ig and
151154 checked_node = this and
152- // The raw guard is true if the value is non-empty
155+ // The raw guard is true if the value is non-empty.
153156 // So we are safe either if we are looking for a non-empty value
154157 // or if we are looking for an empty value and the guard is inverted.
155158 safe_branch = ig .isInverted ( ) .booleanXor ( nonEmpty )
You can’t perform that action at this time.
0 commit comments