arkanalyzer 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/arkanalyzer.json +1 -0
- package/lib/VFG/DVFG.d.ts +43 -0
- package/lib/VFG/DVFG.d.ts.map +1 -0
- package/lib/VFG/DVFG.js +109 -0
- package/lib/VFG/builder/DVFGBuilder.d.ts +17 -0
- package/lib/VFG/builder/DVFGBuilder.d.ts.map +1 -0
- package/lib/VFG/builder/DVFGBuilder.js +111 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/AbstractAnalysis.js +1 -0
- package/lib/callgraph/model/CallGraph.d.ts +4 -0
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
- package/lib/callgraph/model/CallGraph.js +29 -0
- package/lib/callgraph/pointerAnalysis/Pag.js +3 -3
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts +10 -3
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PagBuilder.js +141 -62
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts +2 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +33 -7
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts +7 -2
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.js +10 -4
- package/lib/core/base/Ref.d.ts +0 -1
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +0 -11
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +43 -17
- package/lib/core/common/Builtin.d.ts +2 -0
- package/lib/core/common/Builtin.d.ts.map +1 -1
- package/lib/core/common/Builtin.js +4 -0
- package/lib/core/common/IRInference.d.ts +3 -0
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +67 -27
- package/lib/core/common/SdkUtils.js +1 -1
- package/lib/core/common/TypeInference.d.ts +5 -3
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +92 -59
- package/lib/core/dataflow/ReachingDef.d.ts.map +1 -1
- package/lib/core/dataflow/ReachingDef.js +1 -0
- package/lib/core/graph/BaseImplicitGraph.d.ts +1 -0
- package/lib/core/graph/BaseImplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseImplicitGraph.js +6 -0
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +5 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -2
- package/package.json +2 -2
|
@@ -81,13 +81,13 @@ class TypeInference {
|
|
|
81
81
|
const lastStmt = stmts[stmts.length - 1];
|
|
82
82
|
if (lastStmt instanceof Stmt_1.ArkAssignStmt) {
|
|
83
83
|
rightType = lastStmt.getRightOp().getType();
|
|
84
|
-
if (lastStmt.getLeftOp() instanceof Ref_1.
|
|
84
|
+
if (lastStmt.getLeftOp() instanceof Ref_1.ArkInstanceFieldRef) {
|
|
85
85
|
fieldRef = lastStmt.getLeftOp();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
let fieldType;
|
|
89
89
|
if (beforeType) {
|
|
90
|
-
fieldType = this.inferUnclearedType(beforeType, arkClass
|
|
90
|
+
fieldType = this.inferUnclearedType(beforeType, arkClass);
|
|
91
91
|
}
|
|
92
92
|
if (fieldType) {
|
|
93
93
|
arkField.getSignature().setType(fieldType);
|
|
@@ -105,10 +105,16 @@ class TypeInference {
|
|
|
105
105
|
* The original type is null if failed to infer the type.
|
|
106
106
|
* @param leftOpType
|
|
107
107
|
* @param declaringArkClass
|
|
108
|
-
* @param
|
|
108
|
+
* @param visited
|
|
109
109
|
* @returns
|
|
110
110
|
*/
|
|
111
|
-
static inferUnclearedType(leftOpType, declaringArkClass,
|
|
111
|
+
static inferUnclearedType(leftOpType, declaringArkClass, visited = new Set()) {
|
|
112
|
+
if (visited.has(leftOpType)) {
|
|
113
|
+
return leftOpType;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
visited.add(leftOpType);
|
|
117
|
+
}
|
|
112
118
|
let type;
|
|
113
119
|
if (leftOpType instanceof Type_1.ClassType &&
|
|
114
120
|
leftOpType.getClassSignature().getDeclaringFileSignature().getFileName() === Const_1.UNKNOWN_FILE_NAME) {
|
|
@@ -117,7 +123,7 @@ class TypeInference {
|
|
|
117
123
|
else if (leftOpType instanceof Type_1.UnionType || leftOpType instanceof Type_1.IntersectionType || leftOpType instanceof Type_1.TupleType) {
|
|
118
124
|
let types = leftOpType.getTypes();
|
|
119
125
|
for (let i = 0; i < types.length; i++) {
|
|
120
|
-
let newType = this.inferUnclearedType(types[i], declaringArkClass);
|
|
126
|
+
let newType = this.inferUnclearedType(types[i], declaringArkClass, visited);
|
|
121
127
|
if (newType) {
|
|
122
128
|
types[i] = newType;
|
|
123
129
|
}
|
|
@@ -125,14 +131,14 @@ class TypeInference {
|
|
|
125
131
|
type = leftOpType;
|
|
126
132
|
}
|
|
127
133
|
else if (leftOpType instanceof Type_1.ArrayType) {
|
|
128
|
-
let baseType = this.inferUnclearedType(leftOpType.getBaseType(), declaringArkClass);
|
|
134
|
+
let baseType = this.inferUnclearedType(leftOpType.getBaseType(), declaringArkClass, visited);
|
|
129
135
|
if (baseType) {
|
|
130
136
|
leftOpType.setBaseType(baseType);
|
|
131
137
|
type = leftOpType;
|
|
132
138
|
}
|
|
133
139
|
}
|
|
134
140
|
else if (leftOpType instanceof Type_1.AliasType) {
|
|
135
|
-
let baseType = this.inferUnclearedType(leftOpType.getOriginalType(), declaringArkClass);
|
|
141
|
+
let baseType = this.inferUnclearedType(leftOpType.getOriginalType(), declaringArkClass, visited);
|
|
136
142
|
if (baseType) {
|
|
137
143
|
leftOpType.setOriginalType(baseType);
|
|
138
144
|
type = leftOpType;
|
|
@@ -238,6 +244,10 @@ class TypeInference {
|
|
|
238
244
|
}
|
|
239
245
|
const stmtDef = stmt.getDef();
|
|
240
246
|
if (stmtDef && stmtDef instanceof Ref_1.AbstractRef) {
|
|
247
|
+
if (arkMethod.getName() === Const_1.INSTANCE_INIT_METHOD_NAME && stmtDef instanceof Ref_1.ArkInstanceFieldRef &&
|
|
248
|
+
stmtDef.getBase().getName() === TSConst_1.THIS_NAME && arkMethod.getDeclaringArkClass().isAnonymousClass()) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
241
251
|
const fieldRef = stmtDef.inferType(arkMethod);
|
|
242
252
|
stmt.replaceDef(stmtDef, fieldRef);
|
|
243
253
|
}
|
|
@@ -322,7 +332,13 @@ class TypeInference {
|
|
|
322
332
|
}
|
|
323
333
|
}
|
|
324
334
|
else if (leftOp instanceof Local_1.Local && leftOp.getName() === TSConst_1.THIS_NAME) {
|
|
325
|
-
|
|
335
|
+
const thisLocal = IRInference_1.IRInference.inferThisLocal(arkMethod);
|
|
336
|
+
if (thisLocal) {
|
|
337
|
+
stmt.setLeftOp(thisLocal);
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
leftType = rightType;
|
|
341
|
+
}
|
|
326
342
|
}
|
|
327
343
|
if (leftType && !this.isUnclearType(leftType)) {
|
|
328
344
|
this.setValueType(leftOp, leftType);
|
|
@@ -381,25 +397,31 @@ class TypeInference {
|
|
|
381
397
|
}
|
|
382
398
|
return false;
|
|
383
399
|
}
|
|
384
|
-
// This is the
|
|
385
|
-
static hasUnclearReferenceType(type) {
|
|
400
|
+
// This is the temporal function to check unclearReferenceType recursively and can be removed after typeInfer supports multiple candidate types.
|
|
401
|
+
static hasUnclearReferenceType(type, visited = new Set()) {
|
|
402
|
+
if (visited.has(type)) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
visited.add(type);
|
|
407
|
+
}
|
|
386
408
|
if (type instanceof Type_1.UnclearReferenceType) {
|
|
387
409
|
return true;
|
|
388
410
|
}
|
|
389
411
|
else if (type instanceof Type_1.UnionType || type instanceof Type_1.IntersectionType || type instanceof Type_1.TupleType) {
|
|
390
|
-
return !!type.getTypes().find(t => this.hasUnclearReferenceType(t));
|
|
412
|
+
return !!type.getTypes().find(t => this.hasUnclearReferenceType(t, visited));
|
|
391
413
|
}
|
|
392
414
|
else if (type instanceof Type_1.ArrayType) {
|
|
393
|
-
return this.hasUnclearReferenceType(type.getBaseType());
|
|
415
|
+
return this.hasUnclearReferenceType(type.getBaseType(), visited);
|
|
394
416
|
}
|
|
395
417
|
else if (type instanceof Type_1.AliasType) {
|
|
396
|
-
return this.hasUnclearReferenceType(type.getOriginalType());
|
|
418
|
+
return this.hasUnclearReferenceType(type.getOriginalType(), visited);
|
|
397
419
|
}
|
|
398
420
|
else if (type instanceof TypeExpr_1.KeyofTypeExpr) {
|
|
399
|
-
return this.hasUnclearReferenceType(type.getOpType());
|
|
421
|
+
return this.hasUnclearReferenceType(type.getOpType(), visited);
|
|
400
422
|
}
|
|
401
423
|
else if (type instanceof TypeExpr_1.TypeQueryExpr) {
|
|
402
|
-
return this.hasUnclearReferenceType(type.getType());
|
|
424
|
+
return this.hasUnclearReferenceType(type.getType(), visited);
|
|
403
425
|
}
|
|
404
426
|
return false;
|
|
405
427
|
}
|
|
@@ -624,32 +646,15 @@ class TypeInference {
|
|
|
624
646
|
}
|
|
625
647
|
let propertyAndType = null;
|
|
626
648
|
if (baseType instanceof Type_1.ClassType) {
|
|
627
|
-
|
|
628
|
-
if (!arkClass && fieldName === Builtin_1.Builtin.ITERATOR_RESULT_VALUE && baseType.getClassSignature()
|
|
649
|
+
if (fieldName === Builtin_1.Builtin.ITERATOR_RESULT_VALUE && baseType.getClassSignature()
|
|
629
650
|
.getDeclaringFileSignature().getProjectName() === Builtin_1.Builtin.DUMMY_PROJECT_NAME) {
|
|
630
651
|
const types = baseType.getRealGenericTypes();
|
|
631
652
|
if (types && types.length > 0) {
|
|
632
|
-
|
|
653
|
+
return [null, types[0]];
|
|
633
654
|
}
|
|
655
|
+
return null;
|
|
634
656
|
}
|
|
635
|
-
|
|
636
|
-
return propertyAndType;
|
|
637
|
-
}
|
|
638
|
-
const property = ModelUtils_1.ModelUtils.findPropertyInClass(fieldName, arkClass);
|
|
639
|
-
let propertyType = null;
|
|
640
|
-
if (property instanceof ArkField_1.ArkField) {
|
|
641
|
-
propertyType = property.getType();
|
|
642
|
-
}
|
|
643
|
-
else if (property) {
|
|
644
|
-
propertyType = this.parseArkExport2Type(property);
|
|
645
|
-
}
|
|
646
|
-
if (propertyType) {
|
|
647
|
-
propertyAndType = [property, propertyType];
|
|
648
|
-
}
|
|
649
|
-
else if (arkClass.isAnonymousClass()) {
|
|
650
|
-
const fieldType = this.inferUnclearRefName(fieldName, arkClass);
|
|
651
|
-
propertyAndType = fieldType ? [null, fieldType] : null;
|
|
652
|
-
}
|
|
657
|
+
propertyAndType = this.inferClassFieldType(declareClass, baseType, fieldName);
|
|
653
658
|
}
|
|
654
659
|
else if (baseType instanceof Type_1.AnnotationNamespaceType) {
|
|
655
660
|
const namespace = declareClass.getDeclaringArkFile().getScene().getNamespace(baseType.getNamespaceSignature());
|
|
@@ -666,6 +671,28 @@ class TypeInference {
|
|
|
666
671
|
}
|
|
667
672
|
return propertyAndType;
|
|
668
673
|
}
|
|
674
|
+
static inferClassFieldType(declareClass, baseType, fieldName) {
|
|
675
|
+
const arkClass = declareClass.getDeclaringArkFile().getScene().getClass(baseType.getClassSignature());
|
|
676
|
+
if (!arkClass) {
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
const property = ModelUtils_1.ModelUtils.findPropertyInClass(fieldName, arkClass);
|
|
680
|
+
let propertyType = null;
|
|
681
|
+
if (property instanceof ArkField_1.ArkField) {
|
|
682
|
+
propertyType = property.getType();
|
|
683
|
+
}
|
|
684
|
+
else if (property) {
|
|
685
|
+
propertyType = this.parseArkExport2Type(property);
|
|
686
|
+
}
|
|
687
|
+
if (propertyType) {
|
|
688
|
+
return [property, propertyType];
|
|
689
|
+
}
|
|
690
|
+
else if (arkClass.isAnonymousClass()) {
|
|
691
|
+
const fieldType = this.inferUnclearRefName(fieldName, arkClass);
|
|
692
|
+
return fieldType ? [null, fieldType] : null;
|
|
693
|
+
}
|
|
694
|
+
return null;
|
|
695
|
+
}
|
|
669
696
|
/**
|
|
670
697
|
* Find out the original object and type for a given base name.
|
|
671
698
|
* It returns original type.
|
|
@@ -712,19 +739,37 @@ class TypeInference {
|
|
|
712
739
|
importInfo.setDeclaringArkFile(arkClass.getDeclaringArkFile());
|
|
713
740
|
return TypeInference.parseArkExport2Type((_a = importInfo.getLazyExportInfo()) === null || _a === void 0 ? void 0 : _a.getArkExport());
|
|
714
741
|
}
|
|
715
|
-
static replaceTypeWithReal(type, realTypes) {
|
|
716
|
-
var _a, _b
|
|
742
|
+
static replaceTypeWithReal(type, realTypes, visited = new Set()) {
|
|
743
|
+
var _a, _b;
|
|
744
|
+
if (visited.has(type)) {
|
|
745
|
+
return type;
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
visited.add(type);
|
|
749
|
+
}
|
|
750
|
+
if (type instanceof Type_1.GenericType) {
|
|
751
|
+
const realType = (_b = (_a = realTypes === null || realTypes === void 0 ? void 0 : realTypes[type.getIndex()]) !== null && _a !== void 0 ? _a : type.getDefaultType()) !== null && _b !== void 0 ? _b : type.getConstraint();
|
|
752
|
+
return realType !== null && realType !== void 0 ? realType : type;
|
|
753
|
+
}
|
|
754
|
+
else if (type instanceof Type_1.AnyType) {
|
|
755
|
+
const realType = realTypes === null || realTypes === void 0 ? void 0 : realTypes[0];
|
|
756
|
+
return realType !== null && realType !== void 0 ? realType : type;
|
|
757
|
+
}
|
|
758
|
+
return this.replaceRecursiveType(type, visited, realTypes);
|
|
759
|
+
}
|
|
760
|
+
static replaceRecursiveType(type, visited, realTypes) {
|
|
761
|
+
var _a, _b, _c, _d, _e, _f;
|
|
717
762
|
if (type instanceof Type_1.ClassType) {
|
|
718
|
-
const replacedTypes = (_b = (_a = type.getRealGenericTypes()) === null || _a === void 0 ? void 0 : _a.map(g => this.replaceTypeWithReal(g, realTypes))) !== null && _b !== void 0 ? _b : realTypes;
|
|
763
|
+
const replacedTypes = (_b = (_a = type.getRealGenericTypes()) === null || _a === void 0 ? void 0 : _a.map(g => this.replaceTypeWithReal(g, realTypes, visited))) !== null && _b !== void 0 ? _b : realTypes;
|
|
719
764
|
return replacedTypes && replacedTypes.length > 0 ? new Type_1.ClassType(type.getClassSignature(), replacedTypes) : type;
|
|
720
765
|
}
|
|
721
766
|
else if (type instanceof Type_1.FunctionType) {
|
|
722
|
-
const replacedTypes = (_d = (_c = type.getRealGenericTypes()) === null || _c === void 0 ? void 0 : _c.map(g => this.replaceTypeWithReal(g, realTypes))) !== null && _d !== void 0 ? _d : realTypes;
|
|
767
|
+
const replacedTypes = (_d = (_c = type.getRealGenericTypes()) === null || _c === void 0 ? void 0 : _c.map(g => this.replaceTypeWithReal(g, realTypes, visited))) !== null && _d !== void 0 ? _d : realTypes;
|
|
723
768
|
return replacedTypes && replacedTypes.length > 0 ? new Type_1.FunctionType(type.getMethodSignature(), replacedTypes) : type;
|
|
724
769
|
}
|
|
725
770
|
else if (type instanceof Type_1.AliasType && realTypes) {
|
|
726
|
-
const newObjectType = this.replaceTypeWithReal(type.getOriginalType(), realTypes);
|
|
727
|
-
const replacedTypes = (_f = (_e = type.getRealGenericTypes()) === null || _e === void 0 ? void 0 : _e.map(g => this.replaceTypeWithReal(g, realTypes))) !== null && _f !== void 0 ? _f : realTypes;
|
|
771
|
+
const newObjectType = this.replaceTypeWithReal(type.getOriginalType(), realTypes, visited);
|
|
772
|
+
const replacedTypes = (_f = (_e = type.getRealGenericTypes()) === null || _e === void 0 ? void 0 : _e.map(g => this.replaceTypeWithReal(g, realTypes, visited))) !== null && _f !== void 0 ? _f : realTypes;
|
|
728
773
|
if (replacedTypes.length > 0) {
|
|
729
774
|
const newAliasType = new Type_1.AliasType(type.getName(), newObjectType, type.getSignature(), type.getGenericTypes());
|
|
730
775
|
newAliasType.setRealGenericTypes(replacedTypes);
|
|
@@ -733,35 +778,23 @@ class TypeInference {
|
|
|
733
778
|
}
|
|
734
779
|
else if (type instanceof Type_1.UnionType && realTypes) {
|
|
735
780
|
const types = [];
|
|
736
|
-
type.flatType().forEach(t => types.push(this.replaceTypeWithReal(t, realTypes)));
|
|
737
|
-
return new Type_1.UnionType(types, this.replaceTypeWithReal(type.getCurrType(), realTypes));
|
|
781
|
+
type.flatType().forEach(t => types.push(this.replaceTypeWithReal(t, realTypes, visited)));
|
|
782
|
+
return new Type_1.UnionType(types, this.replaceTypeWithReal(type.getCurrType(), realTypes, visited));
|
|
738
783
|
}
|
|
739
784
|
else if (type instanceof Type_1.IntersectionType && realTypes) {
|
|
740
785
|
const types = [];
|
|
741
|
-
type.getTypes().forEach(t => types.push(this.replaceTypeWithReal(t, realTypes)));
|
|
786
|
+
type.getTypes().forEach(t => types.push(this.replaceTypeWithReal(t, realTypes, visited)));
|
|
742
787
|
return new Type_1.IntersectionType(types);
|
|
743
788
|
}
|
|
744
789
|
else if (type instanceof Type_1.ArrayType && realTypes) {
|
|
745
|
-
const replacedBaseType = this.replaceTypeWithReal(type.getBaseType(), realTypes);
|
|
790
|
+
const replacedBaseType = this.replaceTypeWithReal(type.getBaseType(), realTypes, visited);
|
|
746
791
|
return new Type_1.ArrayType(replacedBaseType, type.getDimension());
|
|
747
792
|
}
|
|
748
793
|
else if (type instanceof Type_1.TupleType && realTypes) {
|
|
749
794
|
let replacedTypes = [];
|
|
750
|
-
type.getTypes().forEach(t => replacedTypes.push(this.replaceTypeWithReal(t, realTypes)));
|
|
795
|
+
type.getTypes().forEach(t => replacedTypes.push(this.replaceTypeWithReal(t, realTypes, visited)));
|
|
751
796
|
return new Type_1.TupleType(replacedTypes);
|
|
752
797
|
}
|
|
753
|
-
else if (type instanceof Type_1.GenericType) {
|
|
754
|
-
const realType = (_h = (_g = realTypes === null || realTypes === void 0 ? void 0 : realTypes[type.getIndex()]) !== null && _g !== void 0 ? _g : type.getDefaultType()) !== null && _h !== void 0 ? _h : type.getConstraint();
|
|
755
|
-
if (realType) {
|
|
756
|
-
return realType;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
else if (type instanceof Type_1.AnyType) {
|
|
760
|
-
const realType = realTypes === null || realTypes === void 0 ? void 0 : realTypes[0];
|
|
761
|
-
if (realType) {
|
|
762
|
-
return realType;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
798
|
return type;
|
|
766
799
|
}
|
|
767
800
|
static replaceAliasType(type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReachingDef.d.ts","sourceRoot":"","sources":["../../../src/core/dataflow/ReachingDef.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAiB,IAAI,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,KAAK,MAAM,GAAG,IAAI,CAAC;AACnB,KAAK,gBAAgB,GAAG,eAAe,CAAC;AAIxC,qBAAa,kBAAmB,YAAW,eAAe,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAChF,SAAS,EAAE,oBAAoB,CAAC;IAChC,gBAAgB,EAAE,2BAA2B,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,gBAAgB,KAAK,gBAAgB,CAAC;IAC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M,EAAE,gBAAgB,CAAC,CAAC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,gBAAgB,CAAuB;gBAElC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,OAAc;CAYzD;AAED;;;;GAIG;AACH,cAAM,oBAAqB,SAAQ,iBAAiB,CAAC,MAAM,CAAE,YAAW,SAAS,CAAC,MAAM,CAAC;IACrF,gBAAgB,EAAE,MAAM,EAAE,CAAC;gBAEf,MAAM,EAAE,SAAS;IAe7B,YAAY,IAAI,MAAM;IAItB,SAAS,IAAI,IAAI;IAIjB,OAAO,CAAC,YAAY;CAyCvB;AAED;;GAEG;AACH,qBAAa,2BAA4B,YAAW,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAC1F,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;gBAExB,SAAS,EAAE,oBAAoB;IAM3C,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,GAAG,gBAAgB;IAevD,OAAO,CAAC,WAAW;CAsBtB"}
|
|
@@ -72,6 +72,7 @@ class ReachingDefFlowGraph extends BaseImplicitGraph_1.BaseImplicitGraph {
|
|
|
72
72
|
}
|
|
73
73
|
const nodes = cfg.getStmts();
|
|
74
74
|
this.nodeToIdMap = new Map(nodes.map((x, i) => [x, i]));
|
|
75
|
+
this.idToNodeMap = new Map(nodes.map((x, i) => [i, x]));
|
|
75
76
|
this.nodesInPostOrder = nodes.map((_, i) => i);
|
|
76
77
|
this.initSuccPred(nodes, cfg);
|
|
77
78
|
}
|
|
@@ -44,6 +44,7 @@ export declare abstract class BaseImplicitGraph<Node> implements GraphTraits<Nod
|
|
|
44
44
|
* @throws Throws an error if idToNodeMap is not initialized or if the node is not found.
|
|
45
45
|
*/
|
|
46
46
|
getNode(id: NodeID): Node;
|
|
47
|
+
getNodeID(s: Node): NodeID;
|
|
47
48
|
/**
|
|
48
49
|
* Checks whether the graph contains a specific node ID.
|
|
49
50
|
* @param id The node ID.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseImplicitGraph.d.ts","sourceRoot":"","sources":["../../../src/core/graph/BaseImplicitGraph.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB;;;;GAIG;AACH,8BAAsB,iBAAiB,CAAC,IAAI,CAAE,YAAW,WAAW,CAAC,IAAI,CAAC;IACtE;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,WAAW,EAAG,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE1C;;;OAGG;IACH,OAAO,EAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEhC;;;OAGG;IACH,OAAO,EAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;;IAIhC;;;OAGG;IACI,UAAU,IAAI,MAAM;IAI3B;;;OAGG;IACI,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC;IAI1C;;;;;OAKG;IACI,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"BaseImplicitGraph.d.ts","sourceRoot":"","sources":["../../../src/core/graph/BaseImplicitGraph.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB;;;;GAIG;AACH,8BAAsB,iBAAiB,CAAC,IAAI,CAAE,YAAW,WAAW,CAAC,IAAI,CAAC;IACtE;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,WAAW,EAAG,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE1C;;;OAGG;IACH,OAAO,EAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEhC;;;OAGG;IACH,OAAO,EAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;;IAIhC;;;OAGG;IACI,UAAU,IAAI,MAAM;IAI3B;;;OAGG;IACI,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC;IAI1C;;;;;OAKG;IACI,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAYzB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM;IASjC;;;;;OAKG;IACI,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAQnC;;;;OAIG;IACI,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE;IAIjC;;;;OAIG;IACI,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE;IAIjC;;;OAGG;IACI,cAAc,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC;IAI1C;;;;OAIG;aACa,YAAY,IAAI,MAAM;CACzC"}
|
|
@@ -37,6 +37,12 @@ class BaseImplicitGraph {
|
|
|
37
37
|
}
|
|
38
38
|
return this.idToNodeMap.get(id);
|
|
39
39
|
}
|
|
40
|
+
getNodeID(s) {
|
|
41
|
+
if (!this.nodeToIdMap.has(s)) {
|
|
42
|
+
throw new Error(`Can find Node # ${s}`);
|
|
43
|
+
}
|
|
44
|
+
return this.nodeToIdMap.get(s);
|
|
45
|
+
}
|
|
40
46
|
/**
|
|
41
47
|
* Checks whether the graph contains a specific node ID.
|
|
42
48
|
* @param id The node ID.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builderUtils.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/builderUtils.ts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BJECT) {
|
|
373
|
+
return Builtin_1.Builtin.OBJECT_CLASS_TYPE;
|
|
374
|
+
}
|
|
372
375
|
return new Type_1.UnclearReferenceType(parameterTypeStr, genericTypes);
|
|
373
376
|
}
|
|
374
377
|
}
|
|
@@ -456,7 +459,8 @@ function tsNode2Type(typeNode, sourceFile, arkInstance) {
|
|
|
456
459
|
return buildTypeFromTypeQuery(typeNode, sourceFile, arkInstance);
|
|
457
460
|
}
|
|
458
461
|
else if (typeNode.kind === ohos_typescript_1.default.SyntaxKind.ObjectKeyword) {
|
|
459
|
-
|
|
462
|
+
// TODO: type object which is different from Object is needed to support, such as let a: object = {}
|
|
463
|
+
return new Type_1.UnclearReferenceType('object');
|
|
460
464
|
}
|
|
461
465
|
else {
|
|
462
466
|
return buildTypeFromPreStr(ohos_typescript_1.default.SyntaxKind[typeNode.kind]);
|
package/lib/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export { CSFuncID, PagBuilder } from './callgraph/pointerAnalysis/PagBuilder';
|
|
|
11
11
|
export { PointerAnalysis } from './callgraph/pointerAnalysis/PointerAnalysis';
|
|
12
12
|
export { PointerAnalysisConfig } from './callgraph/pointerAnalysis/PointerAnalysisConfig';
|
|
13
13
|
export { PtsSet, DiffPTData } from './callgraph/pointerAnalysis/PtsDS';
|
|
14
|
+
export { DVFG } from './VFG/DVFG';
|
|
15
|
+
export { DVFGBuilder } from './VFG/builder/DVFGBuilder';
|
|
14
16
|
export { Constant } from './core/base/Constant';
|
|
15
17
|
export { Decorator } from './core/base/Decorator';
|
|
16
18
|
export { DefUseChain } from './core/base/DefUseChain';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,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,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3G,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,cAAc,4CAA4C,CAAC;AAG3D,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAInD,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -31,8 +31,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.
|
|
35
|
-
exports.ts = exports.Logger = exports.LOG_MODULE_TYPE = exports.LOG_LEVEL = exports.ViewTreePrinter = exports.GraphPrinter = exports.JsonPrinter = exports.SourceFilePrinter = exports.SourceNamespacePrinter = exports.SourceClassPrinter = exports.SourceMethodPrinter = exports.DotFilePrinter = exports.DotNamespacePrinter = exports.DotClassPrinter = exports.DotMethodPrinter = exports.PrinterBuilder = exports.Printer = exports.Scene = exports.SceneConfig = exports.ArkBody = exports.ImportInfo = exports.ExportInfo = exports.ArkField = exports.ArkMethod = void 0;
|
|
34
|
+
exports.ArkFile = exports.SCCDetection = exports.BaseExplicitGraph = exports.BaseNode = exports.BaseEdge = exports.DominanceTree = exports.DominanceFinder = exports.Cfg = exports.BasicBlock = exports.UndefinedVariableSolver = exports.UndefinedVariableChecker = exports.Fact = exports.PathEdge = exports.PathEdgePoint = exports.DataflowSolver = exports.DataflowResult = exports.DataflowProblem = exports.Scope = exports.VisibleValue = exports.ValueUtil = exports.TypeInference = exports.StmtUseReplacer = exports.RefUseReplacer = exports.IRUtils = exports.ExprUseReplacer = exports.DummyMainCreater = exports.ModelUtils = exports.FullPosition = exports.LineColPosition = exports.Local = exports.DefUseChain = exports.Decorator = exports.Constant = exports.DVFGBuilder = exports.DVFG = exports.DiffPTData = exports.PtsSet = exports.PointerAnalysisConfig = exports.PointerAnalysis = exports.PagBuilder = exports.CSFuncID = exports.DummyCallCreator = exports.KLimitedContextSensitive = exports.CallGraphBuilder = exports.CGStat = exports.PAGStat = exports.PTAStat = exports.RapidTypeAnalysis = exports.ClassHierarchyAnalysis = exports.AbstractAnalysis = void 0;
|
|
35
|
+
exports.ts = exports.Logger = exports.LOG_MODULE_TYPE = exports.LOG_LEVEL = exports.ViewTreePrinter = exports.GraphPrinter = exports.JsonPrinter = exports.SourceFilePrinter = exports.SourceNamespacePrinter = exports.SourceClassPrinter = exports.SourceMethodPrinter = exports.DotFilePrinter = exports.DotNamespacePrinter = exports.DotClassPrinter = exports.DotMethodPrinter = exports.PrinterBuilder = exports.Printer = exports.Scene = exports.SceneConfig = exports.ArkBody = exports.ImportInfo = exports.ExportInfo = exports.ArkField = exports.ArkMethod = exports.ArkClass = exports.ArkNamespace = void 0;
|
|
36
36
|
// callgraph/algorithm
|
|
37
37
|
var AbstractAnalysis_1 = require("./callgraph/algorithm/AbstractAnalysis");
|
|
38
38
|
Object.defineProperty(exports, "AbstractAnalysis", { enumerable: true, get: function () { return AbstractAnalysis_1.AbstractAnalysis; } });
|
|
@@ -65,6 +65,10 @@ Object.defineProperty(exports, "PointerAnalysisConfig", { enumerable: true, get:
|
|
|
65
65
|
var PtsDS_1 = require("./callgraph/pointerAnalysis/PtsDS");
|
|
66
66
|
Object.defineProperty(exports, "PtsSet", { enumerable: true, get: function () { return PtsDS_1.PtsSet; } });
|
|
67
67
|
Object.defineProperty(exports, "DiffPTData", { enumerable: true, get: function () { return PtsDS_1.DiffPTData; } });
|
|
68
|
+
var DVFG_1 = require("./VFG/DVFG");
|
|
69
|
+
Object.defineProperty(exports, "DVFG", { enumerable: true, get: function () { return DVFG_1.DVFG; } });
|
|
70
|
+
var DVFGBuilder_1 = require("./VFG/builder/DVFGBuilder");
|
|
71
|
+
Object.defineProperty(exports, "DVFGBuilder", { enumerable: true, get: function () { return DVFGBuilder_1.DVFGBuilder; } });
|
|
68
72
|
// core/base
|
|
69
73
|
var Constant_1 = require("./core/base/Constant");
|
|
70
74
|
Object.defineProperty(exports, "Constant", { enumerable: true, get: function () { return Constant_1.Constant; } });
|