[4452] in Athena Bugs
RT /bin/as
daemon@ATHENA.MIT.EDU (John Carr)
Thu Mar 8 00:51:52 1990
To: bugs@ATHENA.MIT.EDU
Date: Thu, 08 Mar 90 00:51:35 EST
From: John Carr <jfc@ATHENA.MIT.EDU>
Last August I reported that /bin/as could dump core given certain invalid
input (specifically, when an opcode is in the position of an operand, as in
"cas r0, r0, brx"). Here is a fix. This should go to IBM.
[reference: changes.70 #222]
Files are in /source/bsd-4.3/rt/bin/as.
*** /tmp/,RCSt1001412 Thu Mar 8 00:46:10 1990
--- asparse.c Thu Mar 8 00:45:58 1990
***************
*** 848,853 ****
--- 848,856 ----
get_arg:
switch(val) {
+ case IABORT:
+ sawabort();
+ /* NOTREACHED */
default:
disp:
***************
*** 955,960 ****
--- 958,965 ----
shiftover(CM);
} /*processing all the arguments*/
+ if(val == IABORT)
+ exit(1); /* error already printed */
if (argcnt > 6){
yyerror("More than 6 arguments");
goto errorfix;
*** /tmp/,RCSt1001424 Thu Mar 8 00:50:01 1990
--- asscan1.c Thu Mar 8 00:22:22 1990
***************
*** 183,189 ****
} /*end of the debug switch*/
printf("\n");
}
! #endif DEBUG
} else { /* start a new buffer */
if (useVM){
--- 183,197 ----
} /*end of the debug switch*/
printf("\n");
}
! #else
! if((val == ISPEC || val == IJXXX ||
! val == INST0 || val == INSTn) &&
! !ITABCHECK(yyopcode))
! {
! yyerror("Syntax error (opcode as operand?)");
! val = IABORT;
! }
! #endif /* DEBUG */
} else { /* start a new buffer */
if (useVM){
*** /tmp/,RCSt1001436 Thu Mar 8 00:50:45 1990
--- bignum2.c Wed Mar 7 22:59:17 1990
***************
*** 402,408 ****
p2 = (u_char *)chp2;
for (i = 0; i < nbytes; i++){
switch(themap[i]){
! case NOTAKE:
break;
default:
p1[themap[i]] |= p2[i];
--- 402,408 ----
p2 = (u_char *)chp2;
for (i = 0; i < nbytes; i++){
switch(themap[i]){
! case (char) NOTAKE:
break;
default:
p1[themap[i]] |= p2[i];