#include <string.h>
#include <ctype.h>
#include "SDCCglobl.h"
+#include "newalloc.h"
#ifdef HAVE_SYS_ISA_DEFS_H
#include <sys/isa_defs.h>
{
asmop *aop;
- ALLOC(aop,sizeof(asmop));
+ aop = Safe_calloc(sizeof(asmop));
aop->type = type;
return aop;
}
/* special case for a function */
if (IS_FUNC(sym->type)) {
sym->aop = aop = newAsmop(AOP_IMMD);
- ALLOC(aop->aopu.aop_immd,strlen(sym->rname)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
strcpy(aop->aopu.aop_immd,sym->rname);
aop->size = FPTRSIZE;
return aop;
else
strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
- ALLOC(aop->aopu.aop_immd,strlen(buffer)+1);
+ aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
strcpy(aop->aopu.aop_immd,buffer);
return aop;
}
return (dname ? "acc" : "a");
}
sprintf(s,"@%s",aop->aopu.aop_ptr->name);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
else
sprintf(s,"#%s",
aop->aopu.aop_immd);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;
offset);
else
sprintf(s,"%s",aop->aopu.aop_dir);
- ALLOC(rs,strlen(s)+1);
+ rs = Safe_calloc(strlen(s)+1);
strcpy(rs,s);
return rs;