File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
ruby/ql/lib/codeql/ruby/dataflow Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,18 @@ module SummaryComponent {
3232 /** Gets a summary component that represents an element in an array at an unknown index. */
3333 SummaryComponent arrayElementUnknown ( ) { result = SC:: content ( TUnknownArrayElementContent ( ) ) }
3434
35- /** Gets a summary component that represents an element in an array at a known index. */
35+ /**
36+ * Gets a summary component that represents an element in an array at a known index.
37+ *
38+ * Has no result for negative indices. Wrap-around interpretation of negative indices should be
39+ * handled by the caller, if modeling a function that has such behavior.
40+ */
3641 bindingset [ i]
3742 SummaryComponent arrayElementKnown ( int i ) {
3843 result = SC:: content ( TKnownArrayElementContent ( i ) )
3944 or
4045 // `i` may be out of range
46+ i >= 0 and
4147 not exists ( TKnownArrayElementContent ( i ) ) and
4248 result = arrayElementUnknown ( )
4349 }
You can’t perform that action at this time.
0 commit comments