svf-tools 1.0.732 → 1.0.733

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.732",
3
+ "version": "1.0.733",
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": {
@@ -481,7 +481,7 @@ public:
481
481
 
482
482
  // Get all operations of an extern function
483
483
  Operand getBasicOperation(cJSON* obj);
484
- ExtFunctionOps getExtFunctionOps(std::string funName);
484
+ ExtFunctionOps getExtFunctionOps(const SVFFunction* extFunction);
485
485
 
486
486
  // Get property of the operation, e.g. "EFT_A1R_A0R"
487
487
  extType get_type(const SVF::SVFFunction *callee);
@@ -1401,7 +1401,7 @@
1401
1401
  },
1402
1402
  "llvm.va_start": {
1403
1403
  "return": "void",
1404
- "arguments": "(ptr)",
1404
+ "arguments": "(i8*)",
1405
1405
  "type": "EFT_NOOP",
1406
1406
  "overwrite_app_function": 1
1407
1407
  },
@@ -3346,8 +3346,8 @@
3346
3346
  }
3347
3347
  },
3348
3348
  "__sysv_signal": {
3349
- "return": "__sighandler_t",
3350
- "arguments": "(int, __sighandler_t)",
3349
+ "return": "void (i32)*",
3350
+ "arguments": "(i32, void (i32)*)",
3351
3351
  "type": "EFT_ALLOC",
3352
3352
  "overwrite_app_function": 1,
3353
3353
  "AddrStmt": {
@@ -3356,8 +3356,8 @@
3356
3356
  }
3357
3357
  },
3358
3358
  "signal": {
3359
- "return": "sighandler_t",
3360
- "arguments": "(int, sighandler_t)",
3359
+ "return": "void (i32)*",
3360
+ "arguments": "(i32, void (i32)*)",
3361
3361
  "type": "EFT_ALLOC",
3362
3362
  "overwrite_app_function": 1,
3363
3363
  "AddrStmt": {
@@ -5009,7 +5009,7 @@
5009
5009
  },
5010
5010
  "llvm.memset.p0i8.i64": {
5011
5011
  "return": "void",
5012
- "arguments": "(i8*, i8, i64, i32, i1)",
5012
+ "arguments": "(i8*, i8, i64, i1)",
5013
5013
  "type": "EFT_L_A0__A0R_A1",
5014
5014
  "overwrite_app_function": 0,
5015
5015
  "memset_like": {
@@ -5061,7 +5061,7 @@
5061
5061
  },
5062
5062
  "llvm.memcpy.p0i8.p0i8.i64": {
5063
5063
  "return": "void",
5064
- "arguments": "(i8*, *i8, i64, i32, i1)",
5064
+ "arguments": "(i8*, i8*, i64, i1)",
5065
5065
  "type": "EFT_L_A0__A0R_A1R",
5066
5066
  "overwrite_app_function": 0,
5067
5067
  "memcpy_like": {
@@ -5585,7 +5585,7 @@
5585
5585
  },
5586
5586
  "_ZNSt8__detail15_List_node_base7_M_hookEPS0_":{
5587
5587
  "return": "void",
5588
- "arguments": "(std::__detail::_List_node_base*)",
5588
+ "arguments": "(struct.std::__detail::_List_node_base*, struct.std::__detail::_List_node_base*)",
5589
5589
  "type": "EFT_STD_LIST_HOOK",
5590
5590
  "overwrite_app_function": 0,
5591
5591
  "StoreStmt": {
@@ -389,15 +389,19 @@ ExtAPI::Operand ExtAPI::getBasicOperation(cJSON* obj)
389
389
  }
390
390
 
391
391
  // Get all operations of an extern function
392
- ExtAPI::ExtFunctionOps ExtAPI::getExtFunctionOps(std::string funName)
392
+ ExtAPI::ExtFunctionOps ExtAPI::getExtFunctionOps(const SVFFunction* extFunction)
393
393
  {
394
- auto it = extFunToOps.find(funName);
394
+ ExtAPI::ExtFunctionOps extFunctionOps;
395
+ extFunctionOps.setExtFunName(extFunction->getName());
396
+ if (!is_sameSignature(extFunction))
397
+ return extFunctionOps;
398
+
399
+ auto it = extFunToOps.find(extFunction->getName());
395
400
  if (it != extFunToOps.end())
396
401
  return it->second;
397
402
 
398
- ExtAPI::ExtFunctionOps extFunctionOps;
399
- extFunctionOps.setExtFunName(funName);
400
- cJSON* item = get_FunJson(funName);
403
+ extFunctionOps.setExtFunName(extFunction->getName());
404
+ cJSON* item = get_FunJson(extFunction->getName());
401
405
  if (item != nullptr)
402
406
  {
403
407
  cJSON* obj = item->child;
@@ -456,7 +460,7 @@ ExtAPI::ExtFunctionOps ExtAPI::getExtFunctionOps(std::string funName)
456
460
  extFunctionOps.getOperations().push_back(operation);
457
461
  }
458
462
  }
459
- extFunToOps[funName] = extFunctionOps;
463
+ extFunToOps[extFunction->getName()] = extFunctionOps;
460
464
  return extFunctionOps;
461
465
  }
462
466
 
@@ -649,7 +653,8 @@ bool ExtAPI::is_sameSignature(const SVFFunction* F)
649
653
  argNum++;
650
654
  }
651
655
  }
652
- if (F->arg_size() != argNum) // The number of arguments is different
656
+
657
+ if ( !F->isVarArg() && F->arg_size() != argNum) // The number of arguments is different
653
658
  return false;
654
659
  // Is the return type the same?
655
660
  return F->getReturnType()->isPointerTy() == isPointer;
@@ -583,13 +583,12 @@ void SVFIRBuilder::handleExtCall(const SVFInstruction* svfInst, const SVFFunctio
583
583
  {
584
584
  if (isExtCall(svfCallee))
585
585
  {
586
- std::string funName = ExtAPI::getExtAPI()->get_name(svfCallee);
587
- ExtAPI::ExtFunctionOps extFunctionOps = ExtAPI::getExtAPI()->getExtFunctionOps(funName);
586
+ ExtAPI::ExtFunctionOps extFunctionOps = ExtAPI::getExtAPI()->getExtFunctionOps(svfCallee);
588
587
  if (extFunctionOps.getOperations().size() == 0)
589
588
  {
590
589
  std::string str;
591
590
  std::stringstream rawstr(str);
592
- rawstr << "function " << funName << " not in the external function summary ExtAPI.json file";
591
+ rawstr << "function " << svfCallee->getName() << " not in the external function summary ExtAPI.json file";
593
592
  writeWrnMsg(rawstr.str());
594
593
  }
595
594
  else