- // jjenista - we might want to model more of the initial context
- // someday, so keep this trickery in that case. For now, this analysis
- // ignores immutable types which includes String, so the following flat
- // nodes will not add anything to the reach graph.
- //
- //TempDescriptor anArg =
- // new TempDescriptor("analysisEntryTemp_arg",
- // mdSourceEntry.getParamType(0).dereference()
- // );
- //
- //FlatNew fnArg =
- // new FlatNew(mdSourceEntry.getParamType(0).dereference(),
- // anArg,
- // false // is global
- // );
- //
- //TempDescriptor index =
- // new TempDescriptor("analysisEntryTemp_index",
- // new TypeDescriptor(TypeDescriptor.INT)
- // );
- //
- //FlatLiteralNode fl =
- // new FlatLiteralNode(new TypeDescriptor(TypeDescriptor.INT),
- // new Integer( 0 ),
- // index
- // );
- //
- //FlatSetElementNode fse =
- // new FlatSetElementNode(cmdLineArgs,
- // index,
- // anArg
- // );
+ FlatSetElementNode fse =
+ new FlatSetElementNode(cmdLineArgs,
+ index,
+ anArg
+ );
+
+ TypeDescriptor typeSize = new TypeDescriptor(TypeDescriptor.INT);
+ TempDescriptor sizeBytes =
+ new TempDescriptor("analysisEntryTemp_size",
+ typeSize
+ );
+ FlatLiteralNode fls =
+ new FlatLiteralNode(typeSize,
+ new Integer( 1 ),
+ sizeBytes
+ );
+
+ TypeDescriptor typeBytes =
+ new TypeDescriptor(TypeDescriptor.CHAR).makeArray( state );
+ TempDescriptor strBytes =
+ new TempDescriptor("analysisEntryTemp_strBytes",
+ typeBytes
+ );
+ FlatNew fnBytes =
+ new FlatNew(typeBytes,
+ strBytes,
+ //sizeBytes,
+ false // is global
+ );
+ this.constructedCmdLineArgBytesNew = fnBytes;
+
+ ClassDescriptor cdString = argType.getClassDesc();
+ assert cdString != null;
+ FieldDescriptor argBytes = null;
+ Iterator sFieldsItr = cdString.getFields();
+ while( sFieldsItr.hasNext() ) {
+ FieldDescriptor fd = (FieldDescriptor) sFieldsItr.next();
+ if( fd.getSymbol().equals( typeUtil.StringClassValueField ) ) {
+ argBytes = fd;
+ break;
+ }
+ }
+ assert argBytes != null;
+ FlatSetFieldNode fsf =
+ new FlatSetFieldNode(anArg,
+ argBytes,
+ strBytes
+ );