return flag to indicate errors
[repair.git] / Repair / RepairCompiler / MCC / CRuntime / tmap.c
index 25788a6b480f7f0b244f8a96b1784b81d4d9a79e..6cf599a495ea6fe2892a846d3cf0436059efbf9b 100755 (executable)
 #endif
 
 struct typemap * allocatetypemap() {
-  struct typemap *thisvar=(struct typemap *) malloc(sizeof(struct typemap));
 #ifdef CHECKTYPE||CHECKMEMORY
+  struct typemap *thisvar=(struct typemap *) malloc(sizeof(struct typemap));
   thisvar->alloctree=rbinit();
   thisvar->typetree=rbinit();
   thisvar->low=GC_linux_stack_base();
-#endif
   return thisvar;
+#else
+  return NULL;
+#endif
 }
 
 void freefunction(void *ptr) {
@@ -32,20 +34,24 @@ void freetypemap(struct typemap * ptr) {
 }
 
 void typemapreset(struct typemap *ptr) {
+#ifdef CHECKTYPE||CHECKMEMORY
   rbdestroy(ptr->typetree,freefunction);
   ptr->typetree=rbinit();
   if (ptr->low<ptr->high)
     rbdelete(ptr->low,ptr->alloctree);
   else
     rbdelete(ptr->high,ptr->alloctree);
+#endif
 }
 
 void initializetypemapstack(struct typemap * ptr, void *high) {
+#ifdef CHECKTYPE||CHECKMEMORY
   ptr->high=high;
   if (ptr->low<ptr->high)
     rbinsert(ptr->low,ptr->high,NULL,ptr->alloctree);
   else
     rbinsert(ptr->high,ptr->low,NULL,ptr->alloctree);
+#endif
 }
 
 struct structuremap * allocatestructuremap(int s) {