From: j8takagi Date: Fri, 26 Feb 2010 15:26:19 +0000 (+0900) Subject: 微修正 X-Git-Tag: v0.1~14 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb47caa9aec8eb38815713696ad93351b17fc8bc;p=YACASL2.git 微修正 --- diff --git a/src/assemble.c b/src/assemble.c index 0c13893..aedbb11 100644 --- a/src/assemble.c +++ b/src/assemble.c @@ -412,7 +412,7 @@ bool assemble(const char *file, PASS pass) char *line; FILE *fp; - if(create_cmdtype_code() == false) { + if(pass == FIRST && create_cmdtype_code() == false) { return false; } if((fp = fopen(file, "r")) == NULL) { diff --git a/src/cmd.c b/src/cmd.c index df93682..d684d06 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -68,7 +68,7 @@ bool create_cmdtype_code() int i; for(i = 0; i < cmdcodesize; i++) { - np = (CMDCODETAB *) malloc(sizeof(*np)); + np = malloc(sizeof(CMDCODETAB *)); if(np == NULL) { setcerr(122, NULL); /* cannot create hash table */ return false; @@ -133,7 +133,7 @@ bool create_code_type() int i; for(i = 0; i < cmdcodesize; i++) { - if((np = (CMDCODETAB *) malloc(sizeof(*np))) == NULL) { + if((np = malloc(sizeof(CMDCODETAB *))) == NULL) { setcerr(122, NULL); /* cannot create hash table */ return false; }