From 4c76583abac09993ed54a058543b9fce9c862550 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 19 Jan 1989 13:48:09 +0000 Subject: [PATCH] simplified assertion --- mach/proto/as/comm2.y | 9 ++++++--- mach/proto/as/comm4.c | 8 +++++++- mach/proto/as/comm6.c | 2 +- mach/proto/as/comm7.c | 15 +++++++-------- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/mach/proto/as/comm2.y b/mach/proto/as/comm2.y index a8249781c..3dd9675b1 100644 --- a/mach/proto/as/comm2.y +++ b/mach/proto/as/comm2.y @@ -115,16 +115,19 @@ program : /* empty */ newlabel(fb_shift((int)$2)); } | program CODE1 - { emit1((char)$2); LISTLINE(0);} + { emit1((int)$2); LISTLINE(0);} | program CODE2 - { emit2((short)$2); LISTLINE(0);} + { emit2((int)$2); LISTLINE(0);} | program CODE4 { emit4((long)$2); LISTLINE(0);} | program operation ';' | program operation '\n' { lineno++; LISTLINE(1); RELODONE;} | program '#' NUMBER STRING '\n' - { lineno++; LISTLINE(1); RELODONE;} + { lineno = $3; + if (modulename) strncpy(modulename, &stringbuf[1], 63); + LISTLINE(1); RELODONE; + } | program error '\n' { serror("syntax error"); yyerrok; lineno++; LISTLINE(1); RELODONE; diff --git a/mach/proto/as/comm4.c b/mach/proto/as/comm4.c index cc1a68bf7..e1dac7f7d 100644 --- a/mach/proto/as/comm4.c +++ b/mach/proto/as/comm4.c @@ -433,8 +433,14 @@ pass_23(n) newmodule(s) char *s; { + static char nmbuf[64]; + switchsect(S_UND); - modulename = s; + if (s && s != modulename) { + strncpy(nmbuf, s, 63); + modulename = nmbuf; + } + else modulename = s; lineno = 1; #ifdef NEEDED /* diff --git a/mach/proto/as/comm6.c b/mach/proto/as/comm6.c index 1990b0ec3..1ecf20cf1 100644 --- a/mach/proto/as/comm6.c +++ b/mach/proto/as/comm6.c @@ -89,7 +89,7 @@ register item_t *ip; if (store(ip, (valu_t) DOTVAL) == 0) return; #ifdef THREE_PASS - assert(pass != PASS_2 || (oldval -= ip->i_valu) == DOTGAIN); + assert(pass != PASS_2 || oldval - ip->i_valu == DOTGAIN); #endif } diff --git a/mach/proto/as/comm7.c b/mach/proto/as/comm7.c index 87dfd725b..3d0d72a84 100644 --- a/mach/proto/as/comm7.c +++ b/mach/proto/as/comm7.c @@ -233,7 +233,6 @@ small(fitsmall, gain) /* ---------- output ---------- */ emit1(arg) -char arg; { #ifdef LISTING if (listeoln) { @@ -268,12 +267,12 @@ char arg; } emit2(arg) -short arg; +int arg; { #ifdef BYTES_REVERSED - emit1((char)(arg>>8)); emit1((char)arg); + emit1((arg>>8)); emit1(arg); #else - emit1((char)arg); emit1((char)(arg>>8)); + emit1(arg); emit1((arg>>8)); #endif } @@ -281,9 +280,9 @@ emit4(arg) long arg; { #ifdef WORDS_REVERSED - emit2((short)(arg>>16)); emit2((short)(arg)); + emit2((arg>>16)); emit2((arg)); #else - emit2((short)(arg)); emit2((short)(arg>>16)); + emit2((arg)); emit2((arg>>16)); #endif } @@ -293,9 +292,9 @@ int n; { switch (n) { case 1: - emit1((char)val); break; + emit1((int)val); break; case 2: - emit2((short)val); break; + emit2((int)val); break; case 4: emit4((long)val); break; default: -- 2.34.1