fixed bugs, added No_Mem()
This commit is contained in:
parent
1228fe1baf
commit
64e1fa33d3
5 changed files with 11 additions and 6 deletions
|
@ -21,7 +21,6 @@
|
|||
formal parameter in this text.
|
||||
*/
|
||||
struct macro {
|
||||
struct macro *next;
|
||||
char * mc_text; /* the replacement text */
|
||||
int mc_nps; /* number of formal parameters */
|
||||
int mc_length; /* length of replacement text */
|
||||
|
|
|
@ -82,3 +82,8 @@ compile(argc, argv)
|
|||
if (source) WorkingDir = getwdir(dummy);
|
||||
preprocess(source);
|
||||
}
|
||||
|
||||
No_Mem() /* called by alloc package */
|
||||
{
|
||||
fatal("out of memory");
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ do_option(text)
|
|||
{
|
||||
register char *cp = text, *name, *mactext;
|
||||
|
||||
if (class(*cp) != STIDF || class(*cp) == STELL) {
|
||||
if (class(*cp) != STIDF && class(*cp) != STELL) {
|
||||
error("identifier missing in -D%s", text);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ do_pragma()
|
|||
*c_ptr = '\0';
|
||||
while(c != '\n') {
|
||||
if (c_ptr + 1 - cur_line == size) {
|
||||
cur_line = Realloc(cur_line, size + ITEXTSIZE);
|
||||
cur_line = Realloc(cur_line, size += ITEXTSIZE);
|
||||
c_ptr = cur_line + size - 1;
|
||||
}
|
||||
*c_ptr++ = c;
|
||||
|
|
|
@ -186,9 +186,10 @@ expand_defined(repl)
|
|||
}
|
||||
UnGetChar();
|
||||
str = GetIdentifier(0);
|
||||
if (str)
|
||||
id = str2idf(str, 0);
|
||||
else id = 0;
|
||||
if (str) {
|
||||
id = findidf(str);
|
||||
free(str);
|
||||
} else id = 0;
|
||||
assert(id || class(ch) == STELL);
|
||||
ch = GetChar();
|
||||
ch = skipspaces(ch, 0);
|
||||
|
|
Loading…
Reference in a new issue