arkanalyzer 1.0.13 → 1.0.15
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/README.md +10 -10
- package/config/arkanalyzer.json +5 -0
- package/lib/Config.d.ts +2 -0
- package/lib/Config.d.ts.map +1 -1
- package/lib/core/base/Expr.d.ts +3 -0
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +22 -5
- package/lib/core/base/Ref.d.ts +1 -0
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +5 -2
- package/lib/core/base/Stmt.js +1 -1
- package/lib/core/base/Type.d.ts +25 -1
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +39 -2
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +33 -2
- package/lib/core/common/ArkValueTransformer.js +2 -2
- package/lib/core/common/CfgBuilder.d.ts.map +1 -1
- package/lib/core/common/CfgBuilder.js +3 -2
- package/lib/core/common/Const.d.ts +1 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +3 -2
- package/lib/core/common/DummyMainCreater.d.ts +0 -6
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +12 -160
- package/lib/core/common/EtsConst.d.ts +0 -3
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +1 -8
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +8 -2
- package/lib/core/common/IRUtils.d.ts +3 -2
- package/lib/core/common/IRUtils.d.ts.map +1 -1
- package/lib/core/common/IRUtils.js +27 -13
- package/lib/core/common/ModelUtils.d.ts +1 -0
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +14 -23
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +12 -5
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +21 -8
- package/lib/core/dataflow/DataflowProblem.d.ts +0 -1
- package/lib/core/dataflow/DataflowProblem.d.ts.map +1 -1
- package/lib/core/dataflow/DataflowProblem.js +0 -13
- package/lib/core/dataflow/Edge.d.ts +0 -4
- package/lib/core/dataflow/Edge.d.ts.map +1 -1
- package/lib/core/dataflow/Edge.js +1 -10
- package/lib/core/dataflow/UndefinedVariable.d.ts.map +1 -1
- package/lib/core/dataflow/UndefinedVariable.js +28 -21
- package/lib/core/dataflow/Util.d.ts +0 -2
- package/lib/core/dataflow/Util.d.ts.map +1 -1
- package/lib/core/dataflow/Util.js +1 -95
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/ViewTreeBuilder.js +2 -2
- package/lib/core/model/ArkClass.d.ts +5 -0
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +10 -2
- package/lib/core/model/ArkExport.d.ts +3 -1
- package/lib/core/model/ArkExport.d.ts.map +1 -1
- package/lib/core/model/ArkExport.js +9 -3
- package/lib/core/model/ArkFile.d.ts +4 -4
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +7 -6
- package/lib/core/model/ArkMetadata.d.ts +14 -2
- package/lib/core/model/ArkMetadata.d.ts.map +1 -1
- package/lib/core/model/ArkMetadata.js +12 -1
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +4 -2
- package/lib/core/model/ArkSignature.d.ts +10 -0
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +13 -1
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +44 -10
- package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkExportBuilder.js +6 -3
- package/lib/core/model/builder/ArkFieldBuilder.js +2 -2
- package/lib/core/model/builder/ArkImportBuilder.js +6 -6
- package/lib/core/model/builder/ArkMethodBuilder.js +3 -3
- package/lib/core/model/builder/ArkNamespaceBuilder.js +1 -1
- package/lib/core/model/builder/builderUtils.d.ts +2 -2
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +19 -5
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -6
- package/lib/save/source/SourceClass.d.ts.map +1 -1
- package/lib/save/source/SourceClass.js +7 -3
- package/lib/save/source/SourceField.d.ts.map +1 -1
- package/lib/save/source/SourceField.js +7 -3
- package/lib/save/source/SourceMethod.d.ts.map +1 -1
- package/lib/save/source/SourceMethod.js +7 -3
- package/lib/save/source/SourceModule.d.ts.map +1 -1
- package/lib/save/source/SourceModule.js +14 -6
- package/lib/save/source/SourceNamespace.d.ts.map +1 -1
- package/lib/save/source/SourceNamespace.js +8 -6
- package/lib/save/source/SourceStmt.d.ts +1 -0
- package/lib/save/source/SourceStmt.d.ts.map +1 -1
- package/lib/save/source/SourceStmt.js +39 -11
- package/lib/utils/AstTreeUtils.d.ts +5 -0
- package/lib/utils/AstTreeUtils.d.ts.map +1 -0
- package/lib/utils/AstTreeUtils.js +26 -0
- package/lib/utils/entryMethodUtils.d.ts +0 -2
- package/lib/utils/entryMethodUtils.d.ts.map +1 -1
- package/lib/utils/entryMethodUtils.js +1 -31
- package/package.json +3 -3
- package/lib/core/dataflow/TiantAnalysis.d.ts +0 -38
- package/lib/core/dataflow/TiantAnalysis.d.ts.map +0 -1
- package/lib/core/dataflow/TiantAnalysis.js +0 -340
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
-
}
|
|
22
|
-
Object.defineProperty(o, k2, desc);
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
-
}) : function(o, v) {
|
|
30
|
-
o["default"] = v;
|
|
31
|
-
});
|
|
32
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.TiantAnalysisSolver = exports.TiantAnalysisChecker = void 0;
|
|
41
|
-
const DataflowProblem_1 = require("./DataflowProblem");
|
|
42
|
-
const Local_1 = require("../base/Local");
|
|
43
|
-
const Stmt_1 = require("../base/Stmt");
|
|
44
|
-
const Constant_1 = require("../base/Constant");
|
|
45
|
-
const Ref_1 = require("../base/Ref");
|
|
46
|
-
const DataflowSolver_1 = require("./DataflowSolver");
|
|
47
|
-
const Expr_1 = require("../base/Expr");
|
|
48
|
-
const Type_1 = require("../base/Type");
|
|
49
|
-
const ArkSignature_1 = require("../model/ArkSignature");
|
|
50
|
-
const fs = __importStar(require("fs"));
|
|
51
|
-
const Util_1 = require("./Util");
|
|
52
|
-
class TiantAnalysisChecker extends DataflowProblem_1.DataflowProblem {
|
|
53
|
-
constructor(stmt, method) {
|
|
54
|
-
super();
|
|
55
|
-
this.zeroValue = new Constant_1.Constant('zeroValue', Type_1.UndefinedType.getInstance());
|
|
56
|
-
this.classMap = new Map();
|
|
57
|
-
this.globalVariableMap = new Map();
|
|
58
|
-
this.sources = [];
|
|
59
|
-
this.sinks = [];
|
|
60
|
-
this.entryPoint = stmt;
|
|
61
|
-
this.entryMethod = method;
|
|
62
|
-
this.scene = method.getDeclaringArkFile().getScene();
|
|
63
|
-
this.globalVariableMap = this.scene.getGlobalVariableMap();
|
|
64
|
-
}
|
|
65
|
-
getEntryPoint() {
|
|
66
|
-
return this.entryPoint;
|
|
67
|
-
}
|
|
68
|
-
getEntryMethod() {
|
|
69
|
-
return this.entryMethod;
|
|
70
|
-
}
|
|
71
|
-
callSource(val) {
|
|
72
|
-
if (val instanceof Expr_1.AbstractInvokeExpr) {
|
|
73
|
-
for (const source of this.sources) {
|
|
74
|
-
if (source.getSignature() === val.getMethodSignature()) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
setSources(methods) {
|
|
82
|
-
this.sources = methods;
|
|
83
|
-
}
|
|
84
|
-
setSinks(methods) {
|
|
85
|
-
this.sinks = methods;
|
|
86
|
-
}
|
|
87
|
-
getNormalFlowFunction(srcStmt, tgtStmt) {
|
|
88
|
-
let checkerInstance = this;
|
|
89
|
-
return new class {
|
|
90
|
-
getDataFacts(dataFact) {
|
|
91
|
-
let ret = new Set();
|
|
92
|
-
if (checkerInstance.getEntryPoint() === srcStmt && checkerInstance.getZeroValue() === dataFact) {
|
|
93
|
-
let entryMethod = checkerInstance.getEntryMethod();
|
|
94
|
-
const parameters = [...entryMethod.getCfg().getBlocks()][0].getStmts().slice(0, entryMethod.getParameters().length);
|
|
95
|
-
for (let i = 0; i < parameters.length; i++) {
|
|
96
|
-
const para = parameters[i].getDef();
|
|
97
|
-
if (para)
|
|
98
|
-
ret.add(para);
|
|
99
|
-
}
|
|
100
|
-
ret.add(checkerInstance.getZeroValue());
|
|
101
|
-
// 加入所有的全局变量和静态属性(may analysis)
|
|
102
|
-
const staticFields = entryMethod.getDeclaringArkClass().getStaticFields(checkerInstance.classMap);
|
|
103
|
-
for (const field of staticFields) {
|
|
104
|
-
if (field.getInitializer() === undefined) {
|
|
105
|
-
ret.add(new Ref_1.ArkStaticFieldRef(field.getSignature()));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
for (const local of entryMethod.getDeclaringArkClass().getGlobalVariable(checkerInstance.globalVariableMap)) {
|
|
109
|
-
ret.add(local);
|
|
110
|
-
}
|
|
111
|
-
return ret;
|
|
112
|
-
}
|
|
113
|
-
if (!checkerInstance.factEqual(srcStmt.getDef(), dataFact)) {
|
|
114
|
-
if (!(dataFact instanceof Local_1.Local && dataFact.getName() === srcStmt.getDef().toString()))
|
|
115
|
-
ret.add(dataFact);
|
|
116
|
-
}
|
|
117
|
-
if (srcStmt instanceof Stmt_1.ArkAssignStmt) {
|
|
118
|
-
let stmt = srcStmt;
|
|
119
|
-
let assigned = stmt.getLeftOp();
|
|
120
|
-
let rightOp = stmt.getRightOp();
|
|
121
|
-
if (checkerInstance.getZeroValue() === dataFact) {
|
|
122
|
-
if (checkerInstance.callSource(rightOp)) {
|
|
123
|
-
ret.add(assigned);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else if (checkerInstance.factEqual(rightOp, dataFact) || rightOp.getType() instanceof Type_1.UndefinedType) {
|
|
127
|
-
ret.add(assigned);
|
|
128
|
-
if (assigned instanceof Ref_1.ArkInstanceFieldRef) {
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
else if (dataFact instanceof Ref_1.ArkInstanceFieldRef && rightOp === dataFact.getBase()) {
|
|
132
|
-
const field = new Ref_1.ArkInstanceFieldRef(srcStmt.getLeftOp(), dataFact.getFieldSignature());
|
|
133
|
-
ret.add(field);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return ret;
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
getCallFlowFunction(srcStmt, method) {
|
|
141
|
-
let checkerInstance = this;
|
|
142
|
-
return new class {
|
|
143
|
-
getDataFacts(dataFact) {
|
|
144
|
-
const ret = new Set();
|
|
145
|
-
if (checkerInstance.getZeroValue() === dataFact) {
|
|
146
|
-
ret.add(checkerInstance.getZeroValue());
|
|
147
|
-
// 加上调用函数能访问到的所有静态变量,如果不考虑多线程,加上所有变量,考虑则要统计之前已经处理过的变量并排除
|
|
148
|
-
for (const field of method.getDeclaringArkClass().getStaticFields(checkerInstance.classMap)) {
|
|
149
|
-
if (field.getInitializer() === undefined) {
|
|
150
|
-
ret.add(new Ref_1.ArkStaticFieldRef(field.getSignature()));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
for (const local of method.getDeclaringArkClass().getGlobalVariable(checkerInstance.globalVariableMap)) {
|
|
154
|
-
ret.add(local);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
const callExpr = srcStmt.getExprs()[0];
|
|
159
|
-
if (callExpr instanceof Expr_1.ArkInstanceInvokeExpr && dataFact instanceof Ref_1.ArkInstanceFieldRef && callExpr.getBase().getName() === dataFact.getBase().getName()) {
|
|
160
|
-
// todo:base转this
|
|
161
|
-
const _this = [...srcStmt.getCfg().getBlocks()][0].getStmts()[0].getDef();
|
|
162
|
-
const thisRef = new Ref_1.ArkInstanceFieldRef(_this, dataFact.getFieldSignature());
|
|
163
|
-
ret.add(thisRef);
|
|
164
|
-
}
|
|
165
|
-
else if (callExpr instanceof Expr_1.ArkStaticInvokeExpr && dataFact instanceof Ref_1.ArkStaticFieldRef && callExpr.getMethodSignature().getDeclaringClassSignature() === dataFact.getFieldSignature().getDeclaringSignature()) {
|
|
166
|
-
ret.add(dataFact);
|
|
167
|
-
}
|
|
168
|
-
for (const sink of checkerInstance.sinks) {
|
|
169
|
-
if (callExpr.getMethodSignature() === sink.getSignature()) {
|
|
170
|
-
for (const param of callExpr.getArgs()) {
|
|
171
|
-
if (checkerInstance.factEqual(param, dataFact)) {
|
|
172
|
-
console.log("source: " + dataFact);
|
|
173
|
-
console.log("sink: " + srcStmt.getOriginPositionInfo().toString() + ", " + srcStmt.toString());
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
const callStmt = srcStmt;
|
|
180
|
-
const args = callStmt.getInvokeExpr().getArgs();
|
|
181
|
-
for (let i = 0; i < args.length; i++) {
|
|
182
|
-
if (args[i] === dataFact || checkerInstance.callSource(args[i]) && checkerInstance.getZeroValue() === dataFact) {
|
|
183
|
-
const realParameter = [...method.getCfg().getBlocks()][0].getStmts()[i].getDef();
|
|
184
|
-
if (realParameter)
|
|
185
|
-
ret.add(realParameter);
|
|
186
|
-
}
|
|
187
|
-
else if (dataFact instanceof Ref_1.ArkInstanceFieldRef && dataFact.getBase().getName() === args[i].toString()) {
|
|
188
|
-
const realParameter = [...method.getCfg().getBlocks()][0].getStmts()[i].getDef();
|
|
189
|
-
if (realParameter) {
|
|
190
|
-
const retRef = new Ref_1.ArkInstanceFieldRef(realParameter, dataFact.getFieldSignature());
|
|
191
|
-
ret.add(retRef);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return ret;
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
getExitToReturnFlowFunction(srcStmt, tgtStmt, callStmt) {
|
|
200
|
-
let checkerInstance = this;
|
|
201
|
-
return new class {
|
|
202
|
-
getDataFacts(dataFact) {
|
|
203
|
-
let ret = new Set();
|
|
204
|
-
if (dataFact === checkerInstance.getZeroValue()) {
|
|
205
|
-
ret.add(checkerInstance.getZeroValue());
|
|
206
|
-
}
|
|
207
|
-
if (dataFact instanceof Ref_1.ArkInstanceFieldRef && dataFact.getBase().getName() === "this") {
|
|
208
|
-
// todo:this转base。
|
|
209
|
-
const expr = callStmt.getExprs()[0];
|
|
210
|
-
if (expr instanceof Expr_1.ArkInstanceInvokeExpr) {
|
|
211
|
-
const fieldRef = new Ref_1.ArkInstanceFieldRef(expr.getBase(), dataFact.getFieldSignature());
|
|
212
|
-
ret.add(fieldRef);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (!(callStmt instanceof Stmt_1.ArkAssignStmt)) {
|
|
216
|
-
return ret;
|
|
217
|
-
}
|
|
218
|
-
if (srcStmt instanceof Stmt_1.ArkReturnStmt) {
|
|
219
|
-
let ass = callStmt;
|
|
220
|
-
let leftOp = ass.getLeftOp();
|
|
221
|
-
let retVal = srcStmt.getOp();
|
|
222
|
-
if (dataFact === checkerInstance.getZeroValue()) {
|
|
223
|
-
ret.add(checkerInstance.getZeroValue());
|
|
224
|
-
if (checkerInstance.callSource(retVal) || checkerInstance.callSource(ass.getRightOp())) {
|
|
225
|
-
ret.add(leftOp);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
else if (retVal === dataFact) {
|
|
229
|
-
ret.add(leftOp);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return ret;
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
getCallToReturnFlowFunction(srcStmt, tgtStmt) {
|
|
237
|
-
let checkerInstance = this;
|
|
238
|
-
return new class {
|
|
239
|
-
getDataFacts(dataFact) {
|
|
240
|
-
const ret = new Set();
|
|
241
|
-
if (checkerInstance.getZeroValue() === dataFact) {
|
|
242
|
-
ret.add(checkerInstance.getZeroValue());
|
|
243
|
-
}
|
|
244
|
-
const defValue = srcStmt.getDef();
|
|
245
|
-
if (!(defValue && defValue === dataFact)) {
|
|
246
|
-
ret.add(dataFact);
|
|
247
|
-
}
|
|
248
|
-
return ret;
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
createZeroValue() {
|
|
253
|
-
return this.zeroValue;
|
|
254
|
-
}
|
|
255
|
-
getZeroValue() {
|
|
256
|
-
return this.zeroValue;
|
|
257
|
-
}
|
|
258
|
-
Json2ArkMethod(path) {
|
|
259
|
-
let arkMethods = [];
|
|
260
|
-
const data = fs.readFileSync(path, 'utf-8');
|
|
261
|
-
const objects = JSON.parse(data);
|
|
262
|
-
for (const object of objects) {
|
|
263
|
-
const file = this.scene.getFile(new ArkSignature_1.FileSignature(object.sdkName, object.file));
|
|
264
|
-
if (!file) {
|
|
265
|
-
console.log("no file: " + object.file);
|
|
266
|
-
continue;
|
|
267
|
-
}
|
|
268
|
-
let arkClass = null;
|
|
269
|
-
if (object.namespace === "_") {
|
|
270
|
-
for (const clas of file.getClasses()) {
|
|
271
|
-
if (clas.getName() === object.class) {
|
|
272
|
-
arkClass = clas;
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
let arkNamespace = null;
|
|
279
|
-
for (const ns of file.getNamespaces()) {
|
|
280
|
-
if (ns.getName() === object.namespace) {
|
|
281
|
-
arkNamespace = ns;
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
if (arkNamespace) {
|
|
286
|
-
for (const clas of arkNamespace.getClasses()) {
|
|
287
|
-
if (clas.getName() === object.class) {
|
|
288
|
-
arkClass = clas;
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
else {
|
|
294
|
-
console.log("no namespace: " + object.namespace);
|
|
295
|
-
continue;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (!arkClass) {
|
|
299
|
-
console.log("no class: " + object.class);
|
|
300
|
-
continue;
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
let arkMethod = null;
|
|
304
|
-
for (const method of arkClass.getMethods()) {
|
|
305
|
-
if (method.getName() === object.method) {
|
|
306
|
-
arkMethod = method;
|
|
307
|
-
break;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
if (arkMethod) {
|
|
311
|
-
arkMethods.push(arkMethod);
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
console.log("no method: " + object.method);
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return arkMethods;
|
|
320
|
-
}
|
|
321
|
-
factEqual(d1, d2) {
|
|
322
|
-
if (d1 instanceof Constant_1.Constant && d2 instanceof Constant_1.Constant) {
|
|
323
|
-
return d1 === d2;
|
|
324
|
-
}
|
|
325
|
-
else if (d1 instanceof Local_1.Local && d2 instanceof Local_1.Local) {
|
|
326
|
-
return (0, Util_1.LocalEqual)(d1, d2);
|
|
327
|
-
}
|
|
328
|
-
else if (d1 instanceof Ref_1.AbstractRef && d2 instanceof Ref_1.AbstractRef) {
|
|
329
|
-
return (0, Util_1.RefEqual)(d1, d2);
|
|
330
|
-
}
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
exports.TiantAnalysisChecker = TiantAnalysisChecker;
|
|
335
|
-
class TiantAnalysisSolver extends DataflowSolver_1.DataflowSolver {
|
|
336
|
-
constructor(problem, scene) {
|
|
337
|
-
super(problem, scene);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
exports.TiantAnalysisSolver = TiantAnalysisSolver;
|