Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 1c03bcf

Browse files
authored
Merge pull request #82 from vytvir/master
Fix occasional segmentation fault for free_symbol
2 parents 31b7e9e + a5766b7 commit 1c03bcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/sc1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,7 @@ SC_FUNC symbol *fetchfunc(const char *name,int tag)
34453445
sym=addsym(name,code_idx,iFUNCTN,sGLOBAL,tag,0);
34463446
assert(sym!=NULL); /* fatal error 103 must be given on error */
34473447
/* assume no arguments */
3448-
sym->dim.arglist=(arginfo*)malloc(1*sizeof(arginfo));
3448+
sym->dim.arglist=(arginfo*)calloc(1, sizeof(arginfo));
34493449
sym->dim.arglist[0].ident=0;
34503450
/* set library ID to NULL (only for native functions) */
34513451
sym->x.lib=NULL;
@@ -4242,7 +4242,7 @@ static int declargs(symbol *sym,int chkshadow)
42424242
char *ptr;
42434243
int argcnt,oldargcnt,numtags;
42444244
cell val;
4245-
arginfo arg;
4245+
arginfo arg = { 0 };
42464246
arginfo *arglist;
42474247
int ident,fpublic,fconst;
42484248
int idx;

0 commit comments

Comments
 (0)