arkanalyzer 1.0.86 → 1.0.87
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.en.md +69 -65
- package/README.md +56 -70
- package/config/arkanalyzer.json +7 -2
- package/docs/cppFrontend/ArkAnalyzer-cpp_usage_guide.md +245 -0
- package/docs/cppFrontend/cpp_frontend_build_guide.md +126 -0
- package/docs/cppFrontend/cpp_frontend_user_guide.md +175 -0
- package/docs/cppFrontend/img.png +0 -0
- package/docs/cppFrontend/img_1.png +0 -0
- package/docs/cppFrontend/img_10.png +0 -0
- package/docs/cppFrontend/img_11.png +0 -0
- package/docs/cppFrontend/img_12.png +0 -0
- package/docs/cppFrontend/img_13.png +0 -0
- package/docs/cppFrontend/img_14.png +0 -0
- package/docs/cppFrontend/img_15.png +0 -0
- package/docs/cppFrontend/img_16.png +0 -0
- package/docs/cppFrontend/img_17.png +0 -0
- package/docs/cppFrontend/img_18.png +0 -0
- package/docs/cppFrontend/img_19.png +0 -0
- package/docs/cppFrontend/img_2.png +0 -0
- package/docs/cppFrontend/img_20.png +0 -0
- package/docs/cppFrontend/img_21.png +0 -0
- package/docs/cppFrontend/img_22.png +0 -0
- package/docs/cppFrontend/img_23.png +0 -0
- package/docs/cppFrontend/img_3.png +0 -0
- package/docs/cppFrontend/img_4.png +0 -0
- package/docs/cppFrontend/img_5.png +0 -0
- package/docs/cppFrontend/img_6.png +0 -0
- package/docs/cppFrontend/img_7.png +0 -0
- package/docs/cppFrontend/img_8.png +0 -0
- package/docs/cppFrontend/img_9.png +0 -0
- package/docs/sig_programanalysis.en.md +66 -0
- package/docs/sig_programanalysis.md +73 -0
- package/lib/Config.d.ts +32 -1
- package/lib/Config.d.ts.map +1 -1
- package/lib/Config.js +76 -2
- package/lib/Scene.d.ts +25 -2
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +148 -40
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +4 -3
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/AbstractAnalysis.js +17 -17
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +6 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +117 -14
- package/lib/callgraph/common/Statistics.d.ts +4 -2
- package/lib/callgraph/common/Statistics.d.ts.map +1 -1
- package/lib/callgraph/common/Statistics.js +14 -2
- package/lib/callgraph/model/CallGraph.d.ts +12 -8
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
- package/lib/callgraph/model/CallGraph.js +53 -29
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +1 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -1
- package/lib/callgraph/model/builder/CallGraphBuilder.js +5 -1
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Pag.js +3 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +4 -2
- package/lib/cli/cli.d.ts +3 -0
- package/lib/cli/cli.d.ts.map +1 -0
- package/lib/cli/cli.js +82 -0
- package/lib/cli/commands/cg.d.ts +32 -0
- package/lib/cli/commands/cg.d.ts.map +1 -0
- package/lib/cli/commands/cg.js +401 -0
- package/lib/cli/commands/index.d.ts +6 -0
- package/lib/cli/commands/index.d.ts.map +1 -0
- package/lib/cli/commands/index.js +64 -0
- package/lib/cli/commands/ir.d.ts +26 -0
- package/lib/cli/commands/ir.d.ts.map +1 -0
- package/lib/cli/commands/ir.js +94 -0
- package/lib/core/base/Constant.d.ts +1 -1
- package/lib/core/base/Constant.d.ts.map +1 -1
- package/lib/core/base/Constant.js +1 -1
- package/lib/core/base/Expr.d.ts +29 -5
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +144 -22
- package/lib/core/base/Position.d.ts +14 -0
- package/lib/core/base/Position.d.ts.map +1 -1
- package/lib/core/base/Position.js +27 -0
- 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 +4 -1
- package/lib/core/base/Type.d.ts +64 -24
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +144 -49
- package/lib/core/common/ArkError.d.ts +26 -2
- package/lib/core/common/ArkError.d.ts.map +1 -1
- package/lib/core/common/ArkError.js +56 -2
- package/lib/core/common/ArkIRTransformer.d.ts +11 -10
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +1 -1
- package/lib/core/common/ArkValueTransformer.d.ts +14 -12
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +1 -5
- package/lib/core/common/Const.d.ts +3 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +4 -1
- package/lib/core/common/DummyMainCreater.d.ts +23 -13
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +66 -43
- package/lib/core/common/EtsConst.d.ts +11 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +12 -1
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +5 -1
- package/lib/core/common/ModelUtils.d.ts +4 -7
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +77 -110
- package/lib/core/common/SdkUtils.d.ts +1 -1
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +14 -5
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +9 -3
- package/lib/core/graph/BaseExplicitGraph.d.ts +4 -4
- package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseExplicitGraph.js +15 -8
- package/lib/core/graph/BasicBlock.d.ts.map +1 -1
- package/lib/core/graph/Scc.d.ts.map +1 -1
- package/lib/core/graph/Scc.js +7 -2
- package/lib/core/graph/builder/CfgBuilder.d.ts +10 -7
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +12 -5
- package/lib/core/inference/Inference.d.ts.map +1 -1
- package/lib/core/inference/Inference.js +7 -0
- package/lib/core/inference/ModelInference.d.ts +1 -1
- package/lib/core/inference/ModelInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.d.ts +3 -2
- package/lib/core/inference/ValueInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.js +64 -12
- package/lib/core/inference/abc/AbcInference.d.ts +28 -2
- package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
- package/lib/core/inference/abc/AbcInference.js +105 -4
- package/lib/core/model/ArkBaseModel.d.ts +14 -1
- package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
- package/lib/core/model/ArkBaseModel.js +61 -2
- package/lib/core/model/ArkBody.d.ts.map +1 -1
- package/lib/core/model/ArkBody.js +1 -3
- package/lib/core/model/ArkClass.d.ts +22 -2
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +59 -28
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +3 -1
- package/lib/core/model/ArkFile.d.ts +4 -1
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +44 -3
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +9 -1
- package/lib/core/model/ArkMethod.d.ts +5 -0
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +33 -1
- package/lib/core/model/ArkNamespace.d.ts +2 -0
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +11 -0
- package/lib/core/model/ArkSignature.d.ts +3 -3
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +14 -9
- package/lib/core/model/builder/ArkClassBuilder.d.ts +2 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +3 -3
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +4 -1
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +19 -6
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +1 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkNamespaceBuilder.js +2 -1
- package/lib/core/model/builder/BodyBuilder.d.ts +4 -0
- package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.d.ts +1 -0
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +7 -3
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts +296 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.js +145 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts +51 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astUtils.js +470 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts +30 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/const.js +134 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts +9 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Constant.js +33 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts +174 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Expr.js +530 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts +25 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Ref.js +53 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts +8 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Trap.js +28 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts +264 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Type.js +600 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts +109 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +925 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +477 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +2746 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts +57 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/Builtin.js +106 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts +94 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRInference.js +1087 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts +23 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRUtils.js +168 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.js +567 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts +278 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/TypeInference.js +1354 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts +16 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.js +61 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts +182 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +1435 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.js +303 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts +15 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.js +161 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.js +261 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts +12 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.js +155 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts +29 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.js +302 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts +10 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.js +41 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +28 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.js +98 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts +20 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.js +128 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts +11 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +413 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts +5 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +61 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +17 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +285 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts +6 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.js +57 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts +14 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +422 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +8 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +194 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +59 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +605 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts +46 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.js +499 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.js +240 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/node_modules/ohos-typescript/.ohos-typescript-version +1 -0
- package/{node_modules → lib/node_modules}/ohos-typescript/package.json +2 -1
- package/lib/save/CGJsonPrinter.d.ts +8 -0
- package/lib/save/CGJsonPrinter.d.ts.map +1 -0
- package/lib/save/CGJsonPrinter.js +41 -0
- package/lib/save/GraphPrinter.js +2 -2
- package/lib/save/json/JsonDto.d.ts +86 -2
- package/lib/save/json/JsonDto.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.d.ts +1 -1
- package/lib/save/json/JsonSerialization.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.js +235 -145
- package/lib/save/source/SourceTransformer.d.ts.map +1 -1
- package/lib/save/source/SourceTransformer.js +0 -3
- package/lib/utils/CxxSceneUtils.d.ts +11 -0
- package/lib/utils/CxxSceneUtils.d.ts.map +1 -0
- package/lib/utils/CxxSceneUtils.js +178 -0
- package/lib/utils/FileUtils.d.ts +7 -8
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +27 -45
- package/lib/utils/LRUCacheDecorator.d.ts +20 -0
- package/lib/utils/LRUCacheDecorator.d.ts.map +1 -0
- package/lib/utils/LRUCacheDecorator.js +89 -0
- package/lib/utils/ModuleUtils.d.ts +39 -0
- package/lib/utils/ModuleUtils.d.ts.map +1 -0
- package/lib/utils/ModuleUtils.js +261 -0
- package/package.json +10 -7
- /package/{node_modules → lib/node_modules}/ohos-typescript/LICENSE +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.OpenSource +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/SECURITY.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/ThirdPartyNoticeText.txt +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsc +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsserver +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cancellationToken.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.collection.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.core.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.generator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.proxy.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.reflect.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.array.include.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.typedarrays.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asynciterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.regexp.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.bigint.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.date.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.number.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.weakref.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.error.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es5.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es6.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.scripthost.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsc.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserver.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typesMap.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typingsInstaller.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/watchGuard.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -0
|
@@ -8,7 +8,7 @@ import { ArkMethod } from '../../model/ArkMethod';
|
|
|
8
8
|
import { AliasType } from '../../base/Type';
|
|
9
9
|
import { Trap } from '../../base/Trap';
|
|
10
10
|
import { GlobalRef } from '../../base/Ref';
|
|
11
|
-
declare class StatementBuilder {
|
|
11
|
+
export declare class StatementBuilder {
|
|
12
12
|
type: string;
|
|
13
13
|
code: string;
|
|
14
14
|
next: StatementBuilder | null;
|
|
@@ -22,7 +22,7 @@ declare class StatementBuilder {
|
|
|
22
22
|
addressCode3: string[];
|
|
23
23
|
block: BlockBuilder | null;
|
|
24
24
|
ifExitPass: boolean;
|
|
25
|
-
|
|
25
|
+
passTimes: number;
|
|
26
26
|
numOfIdentifier: number;
|
|
27
27
|
isDoWhile: boolean;
|
|
28
28
|
hasDoWhileBody: boolean;
|
|
@@ -52,18 +52,18 @@ export declare class TryStatementBuilder extends StatementBuilder {
|
|
|
52
52
|
afterFinal: StatementBuilder | null;
|
|
53
53
|
constructor(type: string, code: string, astNode: ts.Node, scopeID: number);
|
|
54
54
|
}
|
|
55
|
-
declare class Case {
|
|
55
|
+
export declare class Case {
|
|
56
56
|
value: string;
|
|
57
57
|
stmt: StatementBuilder;
|
|
58
58
|
valueNode: ts.Node;
|
|
59
59
|
constructor(value: string, stmt: StatementBuilder);
|
|
60
60
|
}
|
|
61
|
-
declare class DefUseChain {
|
|
61
|
+
export declare class DefUseChain {
|
|
62
62
|
def: StatementBuilder;
|
|
63
63
|
use: StatementBuilder;
|
|
64
64
|
constructor(def: StatementBuilder, use: StatementBuilder);
|
|
65
65
|
}
|
|
66
|
-
declare class Variable {
|
|
66
|
+
export declare class Variable {
|
|
67
67
|
name: string;
|
|
68
68
|
lastDef: StatementBuilder;
|
|
69
69
|
defUse: DefUseChain[];
|
|
@@ -71,7 +71,7 @@ declare class Variable {
|
|
|
71
71
|
propOf: Variable | null;
|
|
72
72
|
constructor(name: string, lastDef: StatementBuilder);
|
|
73
73
|
}
|
|
74
|
-
declare class Scope {
|
|
74
|
+
export declare class Scope {
|
|
75
75
|
id: number;
|
|
76
76
|
constructor(id: number);
|
|
77
77
|
}
|
|
@@ -85,13 +85,16 @@ export declare class BlockBuilder {
|
|
|
85
85
|
removePredecessorBlock(block: BlockBuilder): boolean;
|
|
86
86
|
removeSuccessorBlock(block: BlockBuilder): boolean;
|
|
87
87
|
}
|
|
88
|
-
declare class Catch {
|
|
88
|
+
export declare class Catch {
|
|
89
89
|
errorName: string;
|
|
90
90
|
from: number;
|
|
91
91
|
to: number;
|
|
92
92
|
withLabel: number;
|
|
93
93
|
constructor(errorName: string, from: number, to: number, withLabel: number);
|
|
94
94
|
}
|
|
95
|
+
export declare class TextError extends Error {
|
|
96
|
+
constructor(message: string);
|
|
97
|
+
}
|
|
95
98
|
export declare class CfgBuilder {
|
|
96
99
|
name: string;
|
|
97
100
|
astRoot: ts.Node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CfgBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/builder/CfgBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAA0C,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,OAAO,EAAE,SAAS,EAA0D,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAW3C,
|
|
1
|
+
{"version":3,"file":"CfgBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/builder/CfgBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAA0C,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,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,EAAE,aAAa,EAAE,UAAU,GAAG,IAAI;WAgB3F,6BAA6B,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,IAAI;WAkB5F,4BAA4B,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI;WAMtF,8BAA8B,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;WAO5D,4BAA4B,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;WAO1D,2BAA2B,CAAC,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAC/F,oBAAoB,EAAE,UAAU,GAAG,IAAI;WAK7B,2CAA2C,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;WAKzE,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;WAYhD,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI;WAKpE,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI;WAKtE,yBAAyB,CAAC,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,UAAU,GAAG,IAAI;CAI3G"}
|
|
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
37
|
return result;
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.CfgBuilder = exports.BlockBuilder = exports.TryStatementBuilder = exports.SwitchStatementBuilder = void 0;
|
|
40
|
+
exports.CfgBuilder = exports.TextError = exports.Catch = exports.BlockBuilder = exports.Scope = exports.Variable = exports.DefUseChain = exports.Case = exports.TryStatementBuilder = exports.SwitchStatementBuilder = exports.StatementBuilder = void 0;
|
|
41
41
|
const ts = __importStar(require("ohos-typescript"));
|
|
42
42
|
const Stmt_1 = require("../../base/Stmt");
|
|
43
43
|
const BasicBlock_1 = require("../BasicBlock");
|
|
@@ -58,7 +58,7 @@ const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER,
|
|
|
58
58
|
class StatementBuilder {
|
|
59
59
|
constructor(type, code, astNode, scopeID) {
|
|
60
60
|
this.addressCode3 = [];
|
|
61
|
-
this.
|
|
61
|
+
this.passTimes = 0;
|
|
62
62
|
this.numOfIdentifier = 0;
|
|
63
63
|
this.isDoWhile = false;
|
|
64
64
|
this.hasDoWhileBody = false;
|
|
@@ -76,6 +76,7 @@ class StatementBuilder {
|
|
|
76
76
|
this.ifExitPass = false;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
exports.StatementBuilder = StatementBuilder;
|
|
79
80
|
class ConditionStatementBuilder extends StatementBuilder {
|
|
80
81
|
constructor(type, code, astNode, scopeID) {
|
|
81
82
|
super(type, code, astNode, scopeID);
|
|
@@ -114,12 +115,14 @@ class Case {
|
|
|
114
115
|
this.stmt = stmt;
|
|
115
116
|
}
|
|
116
117
|
}
|
|
118
|
+
exports.Case = Case;
|
|
117
119
|
class DefUseChain {
|
|
118
120
|
constructor(def, use) {
|
|
119
121
|
this.def = def;
|
|
120
122
|
this.use = use;
|
|
121
123
|
}
|
|
122
124
|
}
|
|
125
|
+
exports.DefUseChain = DefUseChain;
|
|
123
126
|
class Variable {
|
|
124
127
|
constructor(name, lastDef) {
|
|
125
128
|
this.properties = [];
|
|
@@ -129,11 +132,13 @@ class Variable {
|
|
|
129
132
|
this.defUse = [];
|
|
130
133
|
}
|
|
131
134
|
}
|
|
135
|
+
exports.Variable = Variable;
|
|
132
136
|
class Scope {
|
|
133
137
|
constructor(id) {
|
|
134
138
|
this.id = id;
|
|
135
139
|
}
|
|
136
140
|
}
|
|
141
|
+
exports.Scope = Scope;
|
|
137
142
|
class BlockBuilder {
|
|
138
143
|
constructor(id, stmts) {
|
|
139
144
|
this.nexts = [];
|
|
@@ -168,6 +173,7 @@ class Catch {
|
|
|
168
173
|
this.withLabel = withLabel;
|
|
169
174
|
}
|
|
170
175
|
}
|
|
176
|
+
exports.Catch = Catch;
|
|
171
177
|
class TextError extends Error {
|
|
172
178
|
constructor(message) {
|
|
173
179
|
// 调用父类的构造函数,并传入错误消息
|
|
@@ -176,6 +182,7 @@ class TextError extends Error {
|
|
|
176
182
|
this.name = 'TextError';
|
|
177
183
|
}
|
|
178
184
|
}
|
|
185
|
+
exports.TextError = TextError;
|
|
179
186
|
class CfgBuilder {
|
|
180
187
|
constructor(ast, name, declaringMethod, sourceFile) {
|
|
181
188
|
this.exits = [];
|
|
@@ -635,8 +642,8 @@ class CfgBuilder {
|
|
|
635
642
|
if (((stmt.type === 'continueStatement' || stmt.next.type === 'loopStatement') && stmt.next.block) || stmt.next.type.includes('exit')) {
|
|
636
643
|
return null;
|
|
637
644
|
}
|
|
638
|
-
stmt.next.
|
|
639
|
-
if (stmt.next.
|
|
645
|
+
stmt.next.passTimes++;
|
|
646
|
+
if (stmt.next.passTimes === stmt.next.lasts.size || stmt.next.type === 'loopStatement' || stmt.next.isDoWhile) {
|
|
640
647
|
if (stmt.next.scopeID !== stmt.scopeID &&
|
|
641
648
|
!(stmt.next instanceof ConditionStatementBuilder && stmt.next.doStatement) &&
|
|
642
649
|
!(ts.isCaseClause(stmt.astNode) || ts.isDefaultClause(stmt.astNode))) {
|
|
@@ -968,7 +975,7 @@ class CfgBuilder {
|
|
|
968
975
|
ts.isSetAccessorDeclaration(this.astRoot) ||
|
|
969
976
|
ts.isFunctionExpression(this.astRoot) ||
|
|
970
977
|
ts.isClassStaticBlockDeclaration(this.astRoot)) {
|
|
971
|
-
this.astRoot.body ? stmts = [...this.astRoot.body.statements] : this.emptyBody = true;
|
|
978
|
+
this.astRoot.body ? (stmts = [...this.astRoot.body.statements]) : (this.emptyBody = true);
|
|
972
979
|
}
|
|
973
980
|
else if (ts.isArrowFunction(this.astRoot)) {
|
|
974
981
|
if (ts.isBlock(this.astRoot.body)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inference.d.ts","sourceRoot":"","sources":["../../../src/core/inference/Inference.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Inference.d.ts","sourceRoot":"","sources":["../../../src/core/inference/Inference.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAStC,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC;AACrD,KAAK,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;AAG9B;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC;IAE5B;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC;IAEzB;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC;CAChC;AAGD,qBAAa,gBAAgB;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmB;IAC1C,OAAO,CAAC,YAAY,CAAgC;IAEpD,OAAO;WAIO,WAAW,IAAI,gBAAgB;IAOtC,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS;IAsB9C,OAAO,CAAC,qBAAqB;CAchC"}
|
|
@@ -19,6 +19,7 @@ const ArkFile_1 = require("../model/ArkFile");
|
|
|
19
19
|
const ArkTsInference_1 = require("./arkts/ArkTsInference");
|
|
20
20
|
const AbcInference_1 = require("./abc/AbcInference");
|
|
21
21
|
const ValueInference_1 = require("./ValueInference");
|
|
22
|
+
const CxxInference_1 = require("../../frontend/cppFrontend/inference/CxxInference");
|
|
22
23
|
class InferenceManager {
|
|
23
24
|
constructor() {
|
|
24
25
|
this.inferenceMap = new Map();
|
|
@@ -45,6 +46,9 @@ class InferenceManager {
|
|
|
45
46
|
else if (inferLanguage === ValueInference_1.InferLanguage.ARK_TS1_2) {
|
|
46
47
|
inference = new ArkTsInference_1.ArkTs2InferenceBuilder().buildFileInference();
|
|
47
48
|
}
|
|
49
|
+
else if (inferLanguage === ValueInference_1.InferLanguage.CXX) {
|
|
50
|
+
inference = new CxxInference_1.CxxInferenceBuilder().buildFileInference();
|
|
51
|
+
}
|
|
48
52
|
else {
|
|
49
53
|
throw new Error('Inference not supported');
|
|
50
54
|
}
|
|
@@ -65,6 +69,9 @@ class InferenceManager {
|
|
|
65
69
|
else if (lang === ArkFile_1.Language.ARKTS1_2) {
|
|
66
70
|
return ValueInference_1.InferLanguage.ARK_TS1_2;
|
|
67
71
|
}
|
|
72
|
+
else if (lang === ArkFile_1.Language.CXX) {
|
|
73
|
+
return ValueInference_1.InferLanguage.CXX;
|
|
74
|
+
}
|
|
68
75
|
return ValueInference_1.InferLanguage.UNKNOWN;
|
|
69
76
|
}
|
|
70
77
|
}
|
|
@@ -61,7 +61,7 @@ export declare abstract class ImportInfoInference extends ArkModelInference {
|
|
|
61
61
|
postInfer(fromInfo: ImportInfo, exportInfo: ExportInfo | null): void;
|
|
62
62
|
}
|
|
63
63
|
export declare class FileInference extends ArkModelInference {
|
|
64
|
-
|
|
64
|
+
protected importInfoInference: ImportInfoInference;
|
|
65
65
|
private classInference;
|
|
66
66
|
constructor(importInfoInference: ImportInfoInference, classInference: ClassInference);
|
|
67
67
|
getClassInference(): ClassInference;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelInference.d.ts","sourceRoot":"","sources":["../../../src/core/inference/ModelInference.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAA+C,IAAI,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAoB,MAAM,aAAa,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAwC,IAAI,EAAY,MAAM,cAAc,CAAC;AAQpF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOlD;;;;GAIG;AACH,uBAAe,iBAAkB,YAAW,SAAS,EAAE,aAAa;IAChE;;;;;OAKG;aACa,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG;IAE3C;;;;OAIG;IACI,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG;IAWpC;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAGtC;;;;;OAKG;IACI,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG;CAEvD;AAED,8BAAsB,mBAAoB,SAAQ,iBAAiB;IAC/D,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAQ;IAE1C;;;OAGG;aACa,QAAQ,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI;IAEpD;;;OAGG;IACI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B;;OAEG;IACH,OAAO,CAAC,eAAe;CAqC1B"}
|
|
@@ -170,9 +170,8 @@ export declare class InstanceInvokeExprInference extends ValueInference<ArkInsta
|
|
|
170
170
|
}
|
|
171
171
|
export declare class StaticInvokeExprInference extends InstanceInvokeExprInference {
|
|
172
172
|
getValueName(): string;
|
|
173
|
-
preInfer(value: ArkStaticInvokeExpr, stmt: Stmt | undefined): boolean;
|
|
174
173
|
infer(expr: ArkStaticInvokeExpr, stmt: Stmt): Value | undefined;
|
|
175
|
-
|
|
174
|
+
protected getBaseType(expr: ArkStaticInvokeExpr, arkMethod: ArkMethod): Type | null;
|
|
176
175
|
}
|
|
177
176
|
export declare class ArkPtrInvokeExprInference extends StaticInvokeExprInference {
|
|
178
177
|
getValueName(): string;
|
|
@@ -197,6 +196,8 @@ export declare class ArkConditionExprInference extends ArkNormalBinOpExprInferen
|
|
|
197
196
|
getValueName(): string;
|
|
198
197
|
preInfer(value: ArkConditionExpr): boolean;
|
|
199
198
|
infer(value: ArkConditionExpr): Value | undefined;
|
|
199
|
+
private isValueAssignWithLogicalNotExpr;
|
|
200
|
+
private isClassTypeUnionNullUndefined;
|
|
200
201
|
}
|
|
201
202
|
export declare class ArkInstanceOfExprInference extends ValueInference<ArkInstanceOfExpr> {
|
|
202
203
|
getValueName(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueInference.d.ts","sourceRoot":"","sources":["../../../src/core/inference/ValueInference.ts"],"names":[],"mappings":"AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ValueInference.d.ts","sourceRoot":"","sources":["../../../src/core/inference/ValueInference.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAiB,IAAI,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBA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46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
47
|
exports.LocalInference = exports.ArkCastExprInference = exports.ArkInstanceOfExprInference = exports.ArkConditionExprInference = exports.ArkNormalBinOpExprInference = exports.ArkNewArrayExprInference = exports.ArkNewExprInference = exports.ArkPtrInvokeExprInference = exports.StaticInvokeExprInference = exports.InstanceInvokeExprInference = exports.StaticFieldRefInference = exports.FieldRefInference = exports.ClosureFieldRefInference = exports.ParameterRefInference = exports.ValueInference = exports.Bind = exports.valueCtors = exports.InferLanguage = void 0;
|
|
48
|
+
const Stmt_1 = require("../base/Stmt");
|
|
48
49
|
const Type_1 = require("../base/Type");
|
|
49
50
|
const TypeInference_1 = require("../common/TypeInference");
|
|
50
51
|
const IRInference_1 = require("../common/IRInference");
|
|
@@ -60,6 +61,8 @@ const Constant_1 = require("../base/Constant");
|
|
|
60
61
|
const logger_1 = __importStar(require("../../utils/logger"));
|
|
61
62
|
const ArkSignature_1 = require("../model/ArkSignature");
|
|
62
63
|
const Builtin_1 = require("../common/Builtin");
|
|
64
|
+
const ArkFile_1 = require("../model/ArkFile");
|
|
65
|
+
const IRInference_2 = require("../../frontend/cppFrontend/common/IRInference");
|
|
63
66
|
const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER, 'ValueInference');
|
|
64
67
|
var InferLanguage;
|
|
65
68
|
(function (InferLanguage) {
|
|
@@ -364,9 +367,6 @@ let StaticInvokeExprInference = class StaticInvokeExprInference extends Instance
|
|
|
364
367
|
getValueName() {
|
|
365
368
|
return 'ArkStaticInvokeExpr';
|
|
366
369
|
}
|
|
367
|
-
preInfer(value, stmt) {
|
|
368
|
-
return IRInference_1.IRInference.needInfer(value.getMethodSignature().getDeclaringClassSignature().getDeclaringFileSignature());
|
|
369
|
-
}
|
|
370
370
|
infer(expr, stmt) {
|
|
371
371
|
var _a;
|
|
372
372
|
const arkMethod = stmt.getCfg().getDeclaringMethod();
|
|
@@ -392,7 +392,9 @@ let StaticInvokeExprInference = class StaticInvokeExprInference extends Instance
|
|
|
392
392
|
}
|
|
393
393
|
const baseType = this.getBaseType(expr, arkMethod);
|
|
394
394
|
const result = baseType ? IRInference_1.IRInference.inferInstanceMember(baseType, expr, arkMethod, InstanceInvokeExprInference.inferInvokeExpr) :
|
|
395
|
-
|
|
395
|
+
(arkMethod.getDeclaringArkFile().getLanguage() === ArkFile_1.Language.CXX ?
|
|
396
|
+
IRInference_2.IRInference.inferStaticInvokeExprByMethodName(methodName, arkMethod, expr) :
|
|
397
|
+
IRInference_1.IRInference.inferStaticInvokeExprByMethodName(methodName, arkMethod, expr));
|
|
396
398
|
return !result || result === expr ? undefined : result;
|
|
397
399
|
}
|
|
398
400
|
getBaseType(expr, arkMethod) {
|
|
@@ -524,21 +526,71 @@ let ArkConditionExprInference = class ArkConditionExprInference extends ArkNorma
|
|
|
524
526
|
return true;
|
|
525
527
|
}
|
|
526
528
|
infer(value) {
|
|
527
|
-
if (value.getOperator()
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
529
|
+
if (value.getOperator() !== Expr_1.RelationalBinaryOperator.InEquality || value.getOp2() !== ValueUtil_1.ValueUtil.getOrCreateNumberConst(0)) {
|
|
530
|
+
value.fillType();
|
|
531
|
+
return undefined;
|
|
532
|
+
}
|
|
533
|
+
const op1 = value.getOp1();
|
|
534
|
+
const op1Type = op1.getType();
|
|
535
|
+
if (op1Type instanceof Type_1.StringType) {
|
|
536
|
+
value.setOp2(ValueUtil_1.ValueUtil.createStringConst(ValueUtil_1.EMPTY_STRING));
|
|
537
|
+
}
|
|
538
|
+
else if (op1Type instanceof Type_1.BooleanType) {
|
|
539
|
+
value.setOp2(ValueUtil_1.ValueUtil.getBooleanConstant(false));
|
|
540
|
+
}
|
|
541
|
+
else if (op1Type instanceof Type_1.ClassType || op1Type instanceof Type_1.UnknownType || op1Type instanceof Type_1.UnclearReferenceType) {
|
|
542
|
+
const newOp1 = this.isValueAssignWithLogicalNotExpr(op1);
|
|
543
|
+
if (newOp1) {
|
|
544
|
+
value.setOp1(newOp1);
|
|
545
|
+
value.setOperator(Expr_1.RelationalBinaryOperator.Equality);
|
|
534
546
|
}
|
|
535
|
-
|
|
547
|
+
value.setOp2(ValueUtil_1.ValueUtil.getUndefinedConst());
|
|
548
|
+
}
|
|
549
|
+
else if (op1Type instanceof Type_1.UnionType) {
|
|
550
|
+
if (this.isClassTypeUnionNullUndefined(op1Type)) {
|
|
551
|
+
const newOp1 = this.isValueAssignWithLogicalNotExpr(op1);
|
|
552
|
+
if (newOp1) {
|
|
553
|
+
value.setOp1(newOp1);
|
|
554
|
+
value.setOperator(Expr_1.RelationalBinaryOperator.Equality);
|
|
555
|
+
}
|
|
536
556
|
value.setOp2(ValueUtil_1.ValueUtil.getUndefinedConst());
|
|
537
557
|
}
|
|
538
558
|
}
|
|
539
559
|
value.fillType();
|
|
540
560
|
return undefined;
|
|
541
561
|
}
|
|
562
|
+
isValueAssignWithLogicalNotExpr(op) {
|
|
563
|
+
if (!(op instanceof Local_1.Local)) {
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
const declaringStmt = op.getDeclaringStmt();
|
|
567
|
+
if (!declaringStmt || !(declaringStmt instanceof Stmt_1.ArkAssignStmt)) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
const rightOp = declaringStmt.getRightOp();
|
|
571
|
+
if (rightOp instanceof Expr_1.ArkUnopExpr && rightOp.getOperator() === Expr_1.UnaryOperator.LogicalNot) {
|
|
572
|
+
return rightOp.getOp();
|
|
573
|
+
}
|
|
574
|
+
return null;
|
|
575
|
+
}
|
|
576
|
+
isClassTypeUnionNullUndefined(unionType) {
|
|
577
|
+
const types = unionType.getTypes();
|
|
578
|
+
let findClassType = false;
|
|
579
|
+
for (const t of types) {
|
|
580
|
+
if (t instanceof Type_1.NullType || t instanceof Type_1.UndefinedType) {
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
583
|
+
if (t instanceof Type_1.ClassType) {
|
|
584
|
+
if (findClassType) {
|
|
585
|
+
return false;
|
|
586
|
+
}
|
|
587
|
+
findClassType = true;
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
return findClassType;
|
|
593
|
+
}
|
|
542
594
|
};
|
|
543
595
|
ArkConditionExprInference = __decorate([
|
|
544
596
|
Bind()
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ImportInfoInference, MethodInference, StmtInference } from '../ModelInference';
|
|
2
2
|
import { ArkMethod } from '../../model/ArkMethod';
|
|
3
3
|
import { InferenceBuilder } from '../InferenceBuilder';
|
|
4
|
-
import { FieldRefInference } from '../ValueInference';
|
|
4
|
+
import { FieldRefInference, InstanceInvokeExprInference, ValueInference } from '../ValueInference';
|
|
5
5
|
import { Stmt } from '../../base/Stmt';
|
|
6
|
-
import {
|
|
6
|
+
import { Value } from '../../base/Value';
|
|
7
|
+
import { ArkCaughtExceptionRef, ArkInstanceFieldRef } from '../../base/Ref';
|
|
8
|
+
import { ArkInstanceInvokeExpr } from '../../base/Expr';
|
|
7
9
|
export declare class AbcMethodInference extends MethodInference {
|
|
8
10
|
preInfer(arkMethod: ArkMethod): void;
|
|
9
11
|
private inferArkUIComponentLifeCycleMethod;
|
|
@@ -16,5 +18,29 @@ export declare class AbcInferenceBuilder extends InferenceBuilder {
|
|
|
16
18
|
export declare class AbcFieldRefInference extends FieldRefInference {
|
|
17
19
|
getValueName(): string;
|
|
18
20
|
preInfer(value: ArkInstanceFieldRef, stmt: Stmt): boolean;
|
|
21
|
+
infer(value: ArkInstanceFieldRef, stmt: Stmt): Value | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare class AbcInstanceInvokeExprInference extends InstanceInvokeExprInference {
|
|
24
|
+
private static readonly CONTEXT;
|
|
25
|
+
/**
|
|
26
|
+
* Performs inference on an instance invocation expression within the context of a statement
|
|
27
|
+
* Enhances the base implementation with real generic type inference and extension function support
|
|
28
|
+
* @param {ArkInstanceInvokeExpr} value - The invocation expression to infer
|
|
29
|
+
* @param {Stmt} stmt - The statement containing the invocation
|
|
30
|
+
* @returns {Value | undefined} Returns a new expression if transformed, undefined otherwise
|
|
31
|
+
*/
|
|
32
|
+
infer(value: ArkInstanceInvokeExpr, stmt: Stmt): Value | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* process Context function
|
|
35
|
+
* @param value
|
|
36
|
+
* @param arkMethod
|
|
37
|
+
*/
|
|
38
|
+
private processExtendFunc;
|
|
39
|
+
}
|
|
40
|
+
export declare class AbcExceptionRefInference extends ValueInference<ArkCaughtExceptionRef> {
|
|
41
|
+
private static ERROR_TYPE;
|
|
42
|
+
getValueName(): string;
|
|
43
|
+
preInfer(value: ArkCaughtExceptionRef, stmt: Stmt): boolean;
|
|
44
|
+
infer(value: ArkCaughtExceptionRef, stmt: Stmt): Value | undefined;
|
|
19
45
|
}
|
|
20
46
|
//# sourceMappingURL=AbcInference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbcInference.d.ts","sourceRoot":"","sources":["../../../../src/core/inference/abc/AbcInference.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"AbcInference.d.ts","sourceRoot":"","sources":["../../../../src/core/inference/abc/AbcInference.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAQ,iBAAiB,EAAiB,2BAA2B,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC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AAK,GAAG,SAAS;CAa5E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2026 Huawei Device Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2026 Huawei Device Co., Ltd.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
6
6
|
* You may obtain a copy of the License at
|
|
@@ -19,8 +19,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
19
19
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
20
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
21
|
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
var AbcInstanceInvokeExprInference_1, AbcExceptionRefInference_1;
|
|
22
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.AbcFieldRefInference = exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
|
|
27
|
+
exports.AbcExceptionRefInference = exports.AbcInstanceInvokeExprInference = exports.AbcFieldRefInference = exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
|
|
24
28
|
const ModelInference_1 = require("../ModelInference");
|
|
25
29
|
const ModelUtils_1 = require("../../common/ModelUtils");
|
|
26
30
|
const ArkMethod_1 = require("../../model/ArkMethod");
|
|
@@ -32,6 +36,12 @@ const TypeInference_1 = require("../../common/TypeInference");
|
|
|
32
36
|
const Type_1 = require("../../base/Type");
|
|
33
37
|
const Local_1 = require("../../base/Local");
|
|
34
38
|
const Ref_1 = require("../../base/Ref");
|
|
39
|
+
const Const_1 = require("../../common/Const");
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const ArkField_1 = require("../../model/ArkField");
|
|
42
|
+
const IRInference_1 = require("../../common/IRInference");
|
|
43
|
+
const ArkClass_1 = require("../../model/ArkClass");
|
|
44
|
+
const EtsConst_1 = require("../../common/EtsConst");
|
|
35
45
|
class AbcImportInference extends ModelInference_1.ImportInfoInference {
|
|
36
46
|
/**
|
|
37
47
|
* get arkFile and assign to from file
|
|
@@ -43,7 +53,7 @@ class AbcImportInference extends ModelInference_1.ImportInfoInference {
|
|
|
43
53
|
return;
|
|
44
54
|
}
|
|
45
55
|
let file;
|
|
46
|
-
if (
|
|
56
|
+
if (path_1.default.isAbsolute(from)) {
|
|
47
57
|
const scene = fromInfo.getDeclaringArkFile().getScene();
|
|
48
58
|
file = scene.getFile(new ArkSignature_1.FileSignature(fromInfo.getDeclaringArkFile().getProjectName(), from));
|
|
49
59
|
}
|
|
@@ -158,7 +168,8 @@ class AbcStmtInference extends ModelInference_1.StmtInference {
|
|
|
158
168
|
target.setType(srcType);
|
|
159
169
|
return target.getUsedStmts();
|
|
160
170
|
}
|
|
161
|
-
else if (target instanceof Ref_1.AbstractFieldRef)
|
|
171
|
+
else if (target instanceof Ref_1.AbstractFieldRef && projectName === target.getFieldSignature().getDeclaringSignature()
|
|
172
|
+
.getDeclaringFileSignature().getProjectName()) {
|
|
162
173
|
target.getFieldSignature().setType(srcType);
|
|
163
174
|
}
|
|
164
175
|
else if (target instanceof Ref_1.ArkParameterRef) {
|
|
@@ -195,10 +206,100 @@ let AbcFieldRefInference = class AbcFieldRefInference extends ValueInference_1.F
|
|
|
195
206
|
return true;
|
|
196
207
|
}
|
|
197
208
|
}
|
|
209
|
+
const signature = value.getFieldSignature().getDeclaringSignature();
|
|
210
|
+
if (signature instanceof ArkSignature_1.ClassSignature && signature.getClassName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX)) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
198
213
|
return super.preInfer(value, stmt);
|
|
199
214
|
}
|
|
215
|
+
infer(value, stmt) {
|
|
216
|
+
const result = super.infer(value, stmt);
|
|
217
|
+
if (!result && value.getType() instanceof Type_1.UnknownType) {
|
|
218
|
+
const signature = value.getFieldSignature().getDeclaringSignature();
|
|
219
|
+
const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
|
|
220
|
+
if (signature instanceof ArkSignature_1.ClassSignature && signature.getDeclaringFileSignature().getProjectName() === scene.getProjectName()) {
|
|
221
|
+
const cls = scene.getClass(signature);
|
|
222
|
+
if (cls) {
|
|
223
|
+
const field = new ArkField_1.ArkField();
|
|
224
|
+
field.setDeclaringArkClass(cls);
|
|
225
|
+
const fieldSignature = new ArkSignature_1.FieldSignature(value.getFieldSignature().getFieldName(), cls.getSignature(), Type_1.UnknownType.getInstance());
|
|
226
|
+
field.setSignature(fieldSignature);
|
|
227
|
+
cls.addField(field);
|
|
228
|
+
value.setFieldSignature(fieldSignature);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
200
234
|
};
|
|
201
235
|
AbcFieldRefInference = __decorate([
|
|
202
236
|
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
|
|
203
237
|
], AbcFieldRefInference);
|
|
204
238
|
exports.AbcFieldRefInference = AbcFieldRefInference;
|
|
239
|
+
let AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference_1 = class AbcInstanceInvokeExprInference extends ValueInference_1.InstanceInvokeExprInference {
|
|
240
|
+
/**
|
|
241
|
+
* Performs inference on an instance invocation expression within the context of a statement
|
|
242
|
+
* Enhances the base implementation with real generic type inference and extension function support
|
|
243
|
+
* @param {ArkInstanceInvokeExpr} value - The invocation expression to infer
|
|
244
|
+
* @param {Stmt} stmt - The statement containing the invocation
|
|
245
|
+
* @returns {Value | undefined} Returns a new expression if transformed, undefined otherwise
|
|
246
|
+
*/
|
|
247
|
+
infer(value, stmt) {
|
|
248
|
+
var _a;
|
|
249
|
+
const arkMethod = stmt.getCfg().getDeclaringMethod();
|
|
250
|
+
const result = (_a = IRInference_1.IRInference.inferInstanceMember(value.getBase().getType(), value, arkMethod, ValueInference_1.InstanceInvokeExprInference.inferInvokeExpr)) !== null && _a !== void 0 ? _a : this.processExtendFunc(value, arkMethod);
|
|
251
|
+
return !result || result === value ? undefined : result;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* process Context function
|
|
255
|
+
* @param value
|
|
256
|
+
* @param arkMethod
|
|
257
|
+
*/
|
|
258
|
+
processExtendFunc(value, arkMethod) {
|
|
259
|
+
var _a, _b;
|
|
260
|
+
if (value.getBase().getName() === AbcInstanceInvokeExprInference_1.CONTEXT) {
|
|
261
|
+
const scene = arkMethod.getDeclaringArkFile().getScene();
|
|
262
|
+
const signature = (_a = scene.getSdkGlobal(AbcInstanceInvokeExprInference_1.CONTEXT)) === null || _a === void 0 ? void 0 : _a.getSignature();
|
|
263
|
+
if (signature instanceof ArkSignature_1.AliasTypeSignature) {
|
|
264
|
+
const cls = (_b = scene.getMethod(signature.getDeclaringMethodSignature())) === null || _b === void 0 ? void 0 : _b.getDeclaringArkClass();
|
|
265
|
+
if (cls) {
|
|
266
|
+
return IRInference_1.IRInference.inferInstanceMember(new Type_1.ClassType(cls.getSignature(), cls.getGenericsTypes()), value, arkMethod, ValueInference_1.InstanceInvokeExprInference.inferInvokeExpr);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
AbcInstanceInvokeExprInference.CONTEXT = 'Context';
|
|
274
|
+
AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference_1 = __decorate([
|
|
275
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
|
|
276
|
+
], AbcInstanceInvokeExprInference);
|
|
277
|
+
exports.AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference;
|
|
278
|
+
let AbcExceptionRefInference = AbcExceptionRefInference_1 = class AbcExceptionRefInference extends ValueInference_1.ValueInference {
|
|
279
|
+
getValueName() {
|
|
280
|
+
return 'ArkCaughtExceptionRef';
|
|
281
|
+
}
|
|
282
|
+
preInfer(value, stmt) {
|
|
283
|
+
return TypeInference_1.TypeInference.isUnclearType(value.getType());
|
|
284
|
+
}
|
|
285
|
+
infer(value, stmt) {
|
|
286
|
+
var _a;
|
|
287
|
+
if (!AbcExceptionRefInference_1.ERROR_TYPE) {
|
|
288
|
+
const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
|
|
289
|
+
const err = (_a = scene.getSdkArkFiles().find(e => e.getName().endsWith(EtsConst_1.OHOS_BASE_FILE))) === null || _a === void 0 ? void 0 : _a.getClassWithName(EtsConst_1.BUSINESS_ERROR);
|
|
290
|
+
if (err instanceof ArkClass_1.ArkClass) {
|
|
291
|
+
AbcExceptionRefInference_1.ERROR_TYPE = new Type_1.ClassType(err.getSignature(), err.getGenericsTypes());
|
|
292
|
+
value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
|
|
297
|
+
}
|
|
298
|
+
return undefined;
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
AbcExceptionRefInference.ERROR_TYPE = null;
|
|
302
|
+
AbcExceptionRefInference = AbcExceptionRefInference_1 = __decorate([
|
|
303
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
|
|
304
|
+
], AbcExceptionRefInference);
|
|
305
|
+
exports.AbcExceptionRefInference = AbcExceptionRefInference;
|