svf-tools 1.0.655 → 1.0.657

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.655",
3
+ "version": "1.0.657",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -139,13 +139,13 @@ public:
139
139
  return conditionVar;
140
140
  }
141
141
 
142
- s32_t getSuccessorCondValue() const
142
+ s64_t getSuccessorCondValue() const
143
143
  {
144
144
  assert(getCondition() && "this is not a conditional branch edge");
145
145
  return branchCondVal;
146
146
  }
147
147
 
148
- void setBranchCondition(const SVFValue* c, s32_t bVal)
148
+ void setBranchCondition(const SVFValue* c, s64_t bVal)
149
149
  {
150
150
  conditionVar = c;
151
151
  branchCondVal = bVal;
@@ -159,7 +159,7 @@ private:
159
159
  /// e.g., Inst1: br %cmp label 0, label 1, Inst2 is label 0 and Inst 3 is label 1;
160
160
  /// for edge between Inst1 and Inst 2, the first element is %cmp and second element is 0
161
161
  const SVFValue* conditionVar;
162
- s32_t branchCondVal;
162
+ s64_t branchCondVal;
163
163
  };
164
164
 
165
165
  /*!
@@ -1048,7 +1048,7 @@ public:
1048
1048
  {
1049
1049
  return successors.at(i).first;
1050
1050
  }
1051
- s32_t getSuccessorCondValue (u32_t i) const
1051
+ s64_t getSuccessorCondValue (u32_t i) const
1052
1052
  {
1053
1053
  return successors.at(i).second;
1054
1054
  }
@@ -550,8 +550,15 @@ void SVFIR2ItvExeState::translateLoad(const LoadStmt *load)
550
550
  {
551
551
  VAddrs &addrs = getVAddrs(rhs);
552
552
  assert(!getVAddrs(rhs).empty());
553
- _es[lhs] = IntervalValue::bottom();
554
- getVAddrs(lhs).setBottom();
553
+ for (const auto &addr: addrs)
554
+ {
555
+ u32_t objId = getInternalID(addr);
556
+ if (inLocToIValTable(objId))
557
+ _es[lhs] = IntervalValue::bottom();
558
+ else if (inLocToAddrsTable(objId))
559
+ getVAddrs(lhs).setBottom();
560
+ break;
561
+ }
555
562
  for (const auto &addr: addrs)
556
563
  {
557
564
  u32_t objId = getInternalID(addr);
@@ -134,7 +134,9 @@ void ICFGBuilder::processFunBody(WorkList& worklist)
134
134
  /// branch condition value
135
135
  const ConstantInt* condVal = const_cast<SwitchInst*>(si)->findCaseDest(const_cast<BasicBlock*>(succ->getParent()));
136
136
  /// default case is set to -1;
137
- s32_t val = condVal ? condVal->getSExtValue() : -1;
137
+ s64_t val = -1;
138
+ if (condVal && condVal->getBitWidth() <= 64)
139
+ val = condVal->getSExtValue();
138
140
  icfg->addConditionalIntraEdge(srcNode, dstNode, LLVMModuleSet::getLLVMModuleSet()->getSVFValue(si->getCondition()),val);
139
141
  }
140
142
  else
@@ -937,7 +937,9 @@ void SVFIRBuilder::visitSwitchInst(SwitchInst &inst)
937
937
  const Instruction* succInst = &inst.getSuccessor(i)->front();
938
938
  const ConstantInt* condVal = inst.findCaseDest(inst.getSuccessor(i));
939
939
  /// default case is set to -1;
940
- s32_t val = condVal ? condVal->getSExtValue() : -1;
940
+ s64_t val = -1;
941
+ if (condVal && condVal->getBitWidth() <= 64)
942
+ val = condVal->getSExtValue();
941
943
  const SVFInstruction* svfSuccInst = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(succInst);
942
944
  const ICFGNode* icfgNode = pag->getICFG()->getICFGNode(svfSuccInst);
943
945
  successors.push_back(std::make_pair(icfgNode,val));