svf-tools 1.0.1074 → 1.0.1076

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.1074",
3
+ "version": "1.0.1076",
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": {
@@ -89,7 +89,7 @@ public:
89
89
  CallGraph *cg;
90
90
 
91
91
  explicit ICFGIWTO(ICFG* graph, const ICFGNode* node, NodeBS & funcPar, CallGraph* cg) :
92
- Base(graph, node), funcPar(funcPar), cg(cg) {}
92
+ Base(graph, node), funcPar(funcPar), cg(cg) {}
93
93
 
94
94
  virtual ~ICFGIWTO()
95
95
  {
@@ -106,7 +106,7 @@ void AbstractInterpretation::initWTO()
106
106
  }
107
107
  // In WIDEN_TOP or WIDEN_NARROW mode, calculate the IWTO
108
108
  else if (Options::HandleRecur() == WIDEN_ONLY ||
109
- Options::HandleRecur() == WIDEN_NARROW)
109
+ Options::HandleRecur() == WIDEN_NARROW)
110
110
  {
111
111
  const FunObjVar *fun = it->second->getFunction();
112
112
  if (fun->isDeclaration())
@@ -133,10 +133,10 @@ void AbstractInterpretation::initWTO()
133
133
  callSite = *(inEdge->getIndirectCalls().begin());
134
134
  else
135
135
  assert(false && "CallGraphEdge must "
136
- "be either direct or indirect!");
136
+ "be either direct or indirect!");
137
137
 
138
138
  nonRecursiveCallSites.insert(
139
- {callSite, inEdge->getDstNode()->getFunction()->getId()});
139
+ {callSite, inEdge->getDstNode()->getFunction()->getId()});
140
140
  }
141
141
  }
142
142
 
@@ -195,7 +195,7 @@ bool AbstractInterpretation::mergeStatesFromPredecessors(const ICFGNode * icfgNo
195
195
  {
196
196
 
197
197
  if (const IntraCFGEdge *intraCfgEdge =
198
- SVFUtil::dyn_cast<IntraCFGEdge>(edge))
198
+ SVFUtil::dyn_cast<IntraCFGEdge>(edge))
199
199
  {
200
200
  AbstractState tmpEs = abstractTrace[edge->getSrcNode()];
201
201
  if (intraCfgEdge->getCondition())
@@ -220,26 +220,26 @@ bool AbstractInterpretation::mergeStatesFromPredecessors(const ICFGNode * icfgNo
220
220
 
221
221
  // context insensitive implementation
222
222
  workList.push_back(
223
- abstractTrace[callCfgEdge->getSrcNode()]);
223
+ abstractTrace[callCfgEdge->getSrcNode()]);
224
224
  }
225
225
  else if (const RetCFGEdge *retCfgEdge =
226
226
  SVFUtil::dyn_cast<RetCFGEdge>(edge))
227
227
  {
228
228
  switch (Options::HandleRecur())
229
229
  {
230
- case TOP:
231
- {
230
+ case TOP:
231
+ {
232
+ workList.push_back(abstractTrace[retCfgEdge->getSrcNode()]);
233
+ break;
234
+ }
235
+ case WIDEN_ONLY:
236
+ case WIDEN_NARROW:
237
+ {
238
+ const RetICFGNode* returnSite = SVFUtil::dyn_cast<RetICFGNode>(icfgNode);
239
+ const CallICFGNode* callSite = returnSite->getCallICFGNode();
240
+ if (hasAbsStateFromTrace(callSite))
232
241
  workList.push_back(abstractTrace[retCfgEdge->getSrcNode()]);
233
- break;
234
- }
235
- case WIDEN_ONLY:
236
- case WIDEN_NARROW:
237
- {
238
- const RetICFGNode* returnSite = SVFUtil::dyn_cast<RetICFGNode>(icfgNode);
239
- const CallICFGNode* callSite = returnSite->getCallICFGNode();
240
- if (hasAbsStateFromTrace(callSite))
241
- workList.push_back(abstractTrace[retCfgEdge->getSrcNode()]);
242
- }
242
+ }
243
243
  }
244
244
  }
245
245
  else
@@ -692,10 +692,10 @@ void AbstractInterpretation::recursiveCallPass(const CallICFGNode *callNode)
692
692
  }
693
693
 
694
694
  bool AbstractInterpretation::isRecursiveCallSite(const CallICFGNode* callNode,
695
- const FunObjVar* callee)
695
+ const FunObjVar* callee)
696
696
  {
697
697
  return nonRecursiveCallSites.find({callNode, callee->getId()}) ==
698
- nonRecursiveCallSites.end();
698
+ nonRecursiveCallSites.end();
699
699
  }
700
700
 
701
701
  bool AbstractInterpretation::isDirectCall(const CallICFGNode *callNode)
@@ -783,14 +783,20 @@ const OptionMap<AbstractInterpretation::HandleRecur> Options::HandleRecur(
783
783
  "handle-recur",
784
784
  "Recursion handling mode in abstract execution (Default -widen-narrow)",
785
785
  AbstractInterpretation::HandleRecur::WIDEN_NARROW,
786
+ {
787
+ {
788
+ AbstractInterpretation::HandleRecur::TOP, "top",
789
+ "The return value, and any stored object pointed by q at *q = p in recursive functions will be set to the top value."
790
+ },
786
791
  {
787
- {AbstractInterpretation::HandleRecur::TOP, "top",
788
- "The return value, and any stored object pointed by q at *q = p in recursive functions will be set to the top value."},
789
- {AbstractInterpretation::HandleRecur::WIDEN_ONLY, "widen-only",
790
- "Only apply widening at the cycle head of recursive functions."},
791
- {AbstractInterpretation::HandleRecur::WIDEN_NARROW, "widen-narrow",
792
- "Apply both widening and narrowing at the cycle head of recursive functions."}
792
+ AbstractInterpretation::HandleRecur::WIDEN_ONLY, "widen-only",
793
+ "Only apply widening at the cycle head of recursive functions."
794
+ },
795
+ {
796
+ AbstractInterpretation::HandleRecur::WIDEN_NARROW, "widen-narrow",
797
+ "Apply both widening and narrowing at the cycle head of recursive functions."
793
798
  }
799
+ }
794
800
  );
795
801
  const Option<u32_t> Options::Timeout(
796
802
  "timeout", "time out (seconds), set -1 (no timeout), default 14400s",14400);
@@ -727,7 +727,68 @@ void LLVMModuleSet::buildFunToFunMap()
727
727
  }
728
728
  if (cloneBody)
729
729
  {
730
- // Clone the body of extFunToClone into clonedFunction
730
+ // Collect global variables referenced by extFunToClone
731
+ // This step identifies all global variables used within the function to be cloned
732
+ std::set<GlobalVariable*> referencedGlobals;
733
+ for (const BasicBlock& BB : *extFunToClone)
734
+ {
735
+ for (const Instruction& I : BB)
736
+ {
737
+ for (const Value* operand : I.operands())
738
+ {
739
+ // Check if the operand is a global variable
740
+ if (const GlobalVariable* GV = SVFUtil::dyn_cast<GlobalVariable>(operand))
741
+ {
742
+ referencedGlobals.insert(const_cast<GlobalVariable*>(GV));
743
+ }
744
+ }
745
+ }
746
+ }
747
+
748
+ // Copy global variables to target module and update valueMap
749
+ // When cloning a function, we need to ensure all global variables it references are available in the target module
750
+ for (GlobalVariable* GV : referencedGlobals)
751
+ {
752
+ // Check if the global variable already exists in the target module
753
+ GlobalVariable* existingGV = appModule->getGlobalVariable(GV->getName());
754
+ if (existingGV)
755
+ {
756
+ // If the global variable already exists, ensure type consistency
757
+ assert(existingGV->getType() == GV->getType() && "Global variable type mismatch in client module!");
758
+ // Map the original global to the existing one in the target module
759
+ valueMap[GV] = existingGV; // Map to existing global variable
760
+ }
761
+ else
762
+ {
763
+ // If the global variable doesn't exist in the target module, create a new one with the same properties
764
+ GlobalVariable* newGV = new GlobalVariable(
765
+ *appModule, // Target module
766
+ GV->getValueType(), // Type of the global variable
767
+ GV->isConstant(), // Whether it's constant
768
+ GV->getLinkage(), // Linkage type
769
+ nullptr, // No initializer yet
770
+ GV->getName(), // Same name
771
+ nullptr, // No insert before instruction
772
+ GV->getThreadLocalMode(), // Thread local mode
773
+ GV->getAddressSpace() // Address space
774
+ );
775
+
776
+ // Copy initializer if present to maintain the global's value
777
+ if (GV->hasInitializer())
778
+ {
779
+ Constant* init = GV->getInitializer();
780
+ newGV->setInitializer(init); // Simple case: direct copy
781
+ }
782
+
783
+ // Copy other attributes like alignment to ensure identical behavior
784
+ newGV->copyAttributesFrom(GV);
785
+
786
+ // Add mapping from original global to the new one for use during function cloning
787
+ valueMap[GV] = newGV;
788
+ }
789
+ }
790
+
791
+ // Clone function body with updated valueMap
731
792
  llvm::SmallVector<ReturnInst*, 8> ignoredReturns;
732
793
  CloneFunctionInto(clonedFunction, extFunToClone, valueMap, llvm::CloneFunctionChangeType::LocalChangesOnly, ignoredReturns, "", nullptr);
733
794
  }
@@ -1505,4 +1566,4 @@ bool LLVMModuleSet::is_ext(const Function* F)
1505
1566
  return false;
1506
1567
  else
1507
1568
  return !getExtFuncAnnotations(F).empty();
1508
- }
1569
+ }
@@ -255,12 +255,6 @@ char *crypt(const char *key, const char *salt)
255
255
  return NULL;
256
256
  }
257
257
 
258
- __attribute__((annotate("ALLOC_HEAP_RET"), annotate("AllocSize:UNKNOWN")))
259
- char *ctime(const void *timer)
260
- {
261
- return NULL;
262
- }
263
-
264
258
  __attribute__((annotate("ALLOC_HEAP_RET"), annotate("AllocSize:UNKNOWN")))
265
259
  char *dlerror(void)
266
260
  {
@@ -291,12 +285,6 @@ const char *svfgcry_md_algo_name_(int errcode)
291
285
  return NULL;
292
286
  }
293
287
 
294
- __attribute__((annotate("ALLOC_HEAP_RET"), annotate("AllocSize:UNKNOWN")))
295
- char *getenv(const char *name)
296
- {
297
- return NULL;
298
- }
299
-
300
288
  __attribute__((annotate("ALLOC_HEAP_RET"), annotate("AllocSize:UNKNOWN")))
301
289
  char *getlogin(void)
302
290
  {
@@ -1045,242 +1033,241 @@ void _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcRKS3_(void **arg
1045
1033
  *arg0 = arg1;
1046
1034
  }
1047
1035
 
1048
- __attribute__((annotate("ALLOC_STACK_RET")))
1036
+ char getenv_global[10];
1037
+ char *getenv(const char *name)
1038
+ {
1039
+ return getenv_global;
1040
+ }
1041
+
1042
+ unsigned short ctype_b_loc_global[10];
1049
1043
  const unsigned short **__ctype_b_loc(void)
1050
1044
  {
1051
- return NULL;
1045
+ return (const unsigned short **)&ctype_b_loc_global;
1052
1046
  }
1053
1047
 
1054
- __attribute__((annotate("ALLOC_STACK_RET")))
1048
+ int ctype_tolower_loc_global[10];
1055
1049
  int **__ctype_tolower_loc(void)
1056
1050
  {
1057
- return NULL;
1051
+ return &ctype_tolower_loc_global;
1058
1052
  }
1059
1053
 
1060
- __attribute__((annotate("ALLOC_STACK_RET")))
1054
+ int ctype_toupper_loc_global[10];
1061
1055
  int **__ctype_toupper_loc(void)
1062
1056
  {
1063
- return NULL;
1057
+ return &ctype_toupper_loc_global;
1064
1058
  }
1065
1059
 
1066
- __attribute__((annotate("ALLOC_STACK_RET")))
1060
+ int error_global[10];
1067
1061
  int *__errno_location(void)
1068
1062
  {
1069
- return NULL;
1063
+ return error_global;
1070
1064
  }
1071
1065
 
1072
- __attribute__((annotate("ALLOC_STACK_RET")))
1066
+ int h_error_global[10];
1073
1067
  int * __h_errno_location(void)
1074
1068
  {
1075
- return NULL;
1069
+ return h_error_global;
1076
1070
  }
1077
1071
 
1078
- __attribute__((annotate("ALLOC_STACK_RET")))
1072
+ int res_state_global[10];
1079
1073
  void* __res_state(void)
1080
1074
  {
1081
- return NULL;
1075
+ return res_state_global;
1082
1076
  }
1083
1077
 
1084
- __attribute__((annotate("ALLOC_STACK_RET")))
1078
+ void *time_global[10];
1085
1079
  char *asctime(const void *timeptr)
1086
1080
  {
1087
- return NULL;
1081
+ return time_global;
1082
+ }
1083
+
1084
+ char *ctime(const void *timer)
1085
+ {
1086
+ return time_global;
1087
+ }
1088
+
1089
+ void *gmtime(const void *timer)
1090
+ {
1091
+ return time_global;
1088
1092
  }
1089
1093
 
1090
- __attribute__((annotate("ALLOC_STACK_RET")))
1094
+ void *localtime(const void *timer)
1095
+ {
1096
+ return time_global;
1097
+ }
1098
+
1099
+ char bindtextdomain_global[10];
1091
1100
  char * bindtextdomain(const char * domainname, const char * dirname)
1092
1101
  {
1093
- return NULL;
1102
+ return bindtextdomain_global;
1094
1103
  }
1095
1104
 
1096
- __attribute__((annotate("ALLOC_STACK_RET")))
1105
+ char bind_textdomain_codeset_global[10];
1097
1106
  char * bind_textdomain_codeset(const char * domainname, const char * codeset)
1098
1107
  {
1099
- return NULL;
1108
+ return bind_textdomain_codeset_global;
1100
1109
  }
1101
1110
 
1102
- __attribute__((annotate("ALLOC_STACK_RET")))
1111
+ char ctermid_global[10];
1103
1112
  char *ctermid(char *s)
1104
1113
  {
1105
- return s;
1114
+ return s ? s : ctermid_global;
1106
1115
  }
1107
1116
 
1108
- __attribute__((annotate("ALLOC_STACK_RET")))
1117
+ char gettext_global[10];
1109
1118
  char * dcgettext(const char * domainname, const char * msgid, int category)
1110
1119
  {
1111
- return NULL;
1120
+ return gettext_global;
1112
1121
  }
1113
1122
 
1114
- __attribute__((annotate("ALLOC_STACK_RET")))
1115
1123
  char * dgettext(const char * domainname, const char * msgid)
1116
1124
  {
1117
- return NULL;
1125
+ return gettext_global;
1118
1126
  }
1119
1127
 
1120
- __attribute__((annotate("ALLOC_STACK_RET")))
1121
1128
  char * dngettext(const char * domainname, const char * msgid, const char * msgid_plural, unsigned long int n)
1122
1129
  {
1123
- return NULL;
1130
+ return gettext_global;
1124
1131
  }
1125
1132
 
1126
- __attribute__((annotate("ALLOC_STACK_RET")))
1127
- struct group *getgrgid(unsigned int gid)
1133
+ char * gettext(const char * msgid)
1128
1134
  {
1129
- return NULL;
1135
+ return gettext_global;
1130
1136
  }
1131
1137
 
1132
- __attribute__((annotate("ALLOC_STACK_RET")))
1133
- struct group *getgrnam(const char *name)
1138
+ char * ngettext(const char * msgid, const char * msgid_plural, unsigned long int n)
1134
1139
  {
1135
- return NULL;
1140
+ return gettext_global;
1136
1141
  }
1137
1142
 
1138
- __attribute__((annotate("ALLOC_STACK_RET")))
1139
- struct hostent *gethostbyaddr(const void *addr, unsigned int len, int type)
1143
+ void *getgrgid_global[10];
1144
+ void *getgrgid(unsigned int gid)
1140
1145
  {
1141
- return NULL;
1146
+ return getgrgid_global;
1142
1147
  }
1143
1148
 
1144
- __attribute__((annotate("ALLOC_STACK_RET")))
1145
- struct hostent *gethostbyname(const char *name)
1149
+ void *getgrnam_global[10];
1150
+ void *getgrnam(const char *name)
1146
1151
  {
1147
- return NULL;
1152
+ return getgrnam_global;
1148
1153
  }
1149
1154
 
1150
- __attribute__((annotate("ALLOC_STACK_RET")))
1151
- struct hostent *gethostbyname2(const char *name, int af)
1155
+ void *gethostby_global[10];
1156
+ void *gethostbyaddr(const void *addr, unsigned int len, int type)
1152
1157
  {
1153
- return NULL;
1158
+ return gethostby_global;
1154
1159
  }
1155
1160
 
1156
- __attribute__((annotate("ALLOC_STACK_RET")))
1157
- struct mntent *getmntent(void *stream)
1161
+ void *gethostbyname(const char *name)
1158
1162
  {
1159
- return NULL;
1163
+ return gethostby_global;
1160
1164
  }
1161
1165
 
1162
- __attribute__((annotate("ALLOC_STACK_RET")))
1163
- struct protoent *getprotobyname(const char *name)
1166
+ void *gethostbyname2(const char *name, int af)
1164
1167
  {
1165
- return NULL;
1168
+ return gethostby_global;
1166
1169
  }
1167
1170
 
1168
- __attribute__((annotate("ALLOC_STACK_RET")))
1169
- struct protoent *getprotobynumber(int proto)
1171
+ void *getmntent_global[10];
1172
+ void *getmntent(void *stream)
1170
1173
  {
1171
- return NULL;
1174
+ return getmntent_global;
1172
1175
  }
1173
1176
 
1174
- __attribute__((annotate("ALLOC_STACK_RET")))
1175
- struct passwd *getpwent(void)
1177
+ void *getproto_global[10];
1178
+ void *getprotobyname(const char *name)
1176
1179
  {
1177
- return NULL;
1180
+ return getproto_global;
1178
1181
  }
1179
1182
 
1180
- __attribute__((annotate("ALLOC_STACK_RET")))
1181
- struct passwd *getpwnam(const char *name)
1183
+ void *getprotobynumber(int proto)
1182
1184
  {
1183
- return NULL;
1185
+ return getproto_global;
1184
1186
  }
1185
1187
 
1186
- __attribute__((annotate("ALLOC_STACK_RET")))
1187
- struct passwd *getpwuid(unsigned int uid)
1188
+ void *getpw_global[10];
1189
+ void *getpwent(void)
1188
1190
  {
1189
- return NULL;
1191
+ return getpw_global;
1190
1192
  }
1191
1193
 
1192
- __attribute__((annotate("ALLOC_STACK_RET")))
1193
- struct servent *getservbyname(const char *name, const char *proto)
1194
+ void *getpwnam(const char *name)
1194
1195
  {
1195
- return NULL;
1196
+ return getpw_global;
1196
1197
  }
1197
1198
 
1198
- __attribute__((annotate("ALLOC_STACK_RET")))
1199
- struct servent *getservbyport(int port, const char *proto)
1199
+ void *getpwuid(unsigned int uid)
1200
1200
  {
1201
- return NULL;
1201
+ return getpw_global;
1202
1202
  }
1203
1203
 
1204
- __attribute__((annotate("ALLOC_STACK_RET")))
1205
- struct spwd *getspnam(const char *name)
1204
+ void *getserv_global[10];
1205
+ void *getservbyname(const char *name, const char *proto)
1206
1206
  {
1207
- return NULL;
1207
+ return getserv_global;
1208
1208
  }
1209
1209
 
1210
- __attribute__((annotate("ALLOC_STACK_RET")))
1211
- char * gettext(const char * msgid)
1210
+ void *getservbyport(int port, const char *proto)
1212
1211
  {
1213
- return NULL;
1212
+ return getserv_global;
1214
1213
  }
1215
1214
 
1216
- __attribute__((annotate("ALLOC_STACK_RET")))
1217
- struct tm *gmtime(const void *timer)
1215
+ void *getspnam_global[10];
1216
+ void *getspnam(const char *name)
1218
1217
  {
1219
- return NULL;
1218
+ return getspnam_global;
1220
1219
  }
1221
1220
 
1222
- __attribute__((annotate("ALLOC_STACK_RET")))
1221
+ char gnu_get_libc_version_global[10];
1223
1222
  const char *gnu_get_libc_version(void)
1224
1223
  {
1225
- return NULL;
1224
+ return gnu_get_libc_version_global;
1226
1225
  }
1227
1226
 
1228
- __attribute__((annotate("ALLOC_STACK_RET")))
1227
+ char gnutls_check_version_global[10];
1229
1228
  const char * gnutls_check_version(const char * req_version)
1230
1229
  {
1231
- return NULL;
1232
- }
1233
-
1234
- __attribute__((annotate("ALLOC_STACK_RET")))
1235
- struct lconv *localeconv(void)
1236
- {
1237
- return NULL;
1230
+ return gnutls_check_version_global;
1238
1231
  }
1239
1232
 
1240
- __attribute__((annotate("ALLOC_STACK_RET")))
1241
- struct tm *localtime(const void *timer)
1233
+ void *localeconv_global[10];
1234
+ void *localeconv(void)
1242
1235
  {
1243
- return NULL;
1236
+ return localeconv_global;
1244
1237
  }
1245
1238
 
1246
- __attribute__((annotate("ALLOC_STACK_RET")))
1247
- char * ngettext(const char * msgid, const char * msgid_plural, unsigned long int n)
1248
- {
1249
- return NULL;
1250
- }
1251
-
1252
- __attribute__((annotate("ALLOC_STACK_RET")))
1239
+ void *pango_cairo_font_map_global[10];
1253
1240
  void *pango_cairo_font_map_get_default(void)
1254
1241
  {
1255
- return NULL;
1242
+ return pango_cairo_font_map_global;
1256
1243
  }
1257
1244
 
1258
- __attribute__((annotate("ALLOC_STACK_RET")))
1245
+ char re_comp_global[10];
1259
1246
  char *re_comp(const char *regex)
1260
1247
  {
1261
- return NULL;
1248
+ return re_comp_global;
1262
1249
  }
1263
1250
 
1264
- __attribute__((annotate("ALLOC_STACK_RET")))
1251
+ char setlocale_global[10];
1265
1252
  char *setlocale(int category, const char *locale)
1266
1253
  {
1267
- return NULL;
1254
+ return setlocale_global;
1268
1255
  }
1269
1256
 
1270
- __attribute__((annotate("ALLOC_STACK_RET")))
1257
+ char tgoto_global[10];
1271
1258
  char *tgoto(const char *cap, int col, int row)
1272
1259
  {
1273
- return NULL;
1260
+ return tgoto_global;
1274
1261
  }
1275
1262
 
1276
- __attribute__((annotate("ALLOC_STACK_RET")))
1263
+ char tparm_global[10];
1277
1264
  char *tparm(char *str, ...)
1278
1265
  {
1279
- return NULL;
1266
+ return tparm_global;
1280
1267
  }
1281
1268
 
1282
- __attribute__((annotate("ALLOC_STACK_RET")))
1269
+ char zError_global[10];
1283
1270
  const char *zError(int a)
1284
1271
  {
1285
- return NULL;
1286
- }
1272
+ return zError_global;
1273
+ }