@@ -159,10 +159,10 @@ class ArrayAllocation extends TArrayAllocation {
159159 * array, and the minimum estimated value for a heap-allocated one.
160160 */
161161 int getLength ( DataFlow:: Node node ) {
162- exists ( IndirectUninitializedNode inode |
162+ exists ( DataFlow :: IndirectUninitializedNode inode |
163163 inode = node and
164164 inode .getLocalVariable ( ) = this .asStackAllocation ( ) .getVariable ( ) and
165- result = this .asStackAllocation ( ) .getLength ( inode .getIndirection ( ) )
165+ result = this .asStackAllocation ( ) .getLength ( inode .getIndirectionIndex ( ) )
166166 )
167167 or
168168 node .asUninitialized ( ) = this .asStackAllocation ( ) .getVariable ( ) and
@@ -193,33 +193,6 @@ class ArrayAllocation extends TArrayAllocation {
193193 }
194194}
195195
196- /*
197- * NOTE: `IndirectUninitializedNode` has made its way into `github/codeql`. Once we upgrade it to
198- * the version that has it, the class can be safely removed.
199- */
200-
201- import semmle.code.cpp.ir.dataflow.internal.SsaInternals as SsaImpl
202-
203- class IndirectUninitializedNode extends Node {
204- LocalVariable v ;
205- int indirection ;
206-
207- IndirectUninitializedNode ( ) {
208- exists ( SsaImpl:: Definition def , SsaImpl:: SourceVariable sv |
209- def .getIndirectionIndex ( ) = indirection and
210- indirection > 0 and
211- def .getValue ( ) .asInstruction ( ) instanceof UninitializedInstruction and
212- SsaImpl:: defToNode ( this , def , sv ) and
213- v = sv .getBaseVariable ( ) .( SsaImpl:: BaseIRVariable ) .getIRVariable ( ) .getAst ( )
214- )
215- }
216-
217- /** Gets the uninitialized local variable corresponding to this node. */
218- LocalVariable getLocalVariable ( ) { result = v }
219-
220- int getIndirection ( ) { result = indirection }
221- }
222-
223196newtype TPointerFormation =
224197 TArrayExpr ( ArrayExprBA arrayExpr ) or
225198 TPointerArithmetic ( PointerArithmeticOperation pointerArithmetic ) or
0 commit comments