[net.bugs.4bsd] Bug in 4.1bsd /bin/as

duk@klipper.UUCP (Duk Bekema) (01/21/85)

If you redefine a label beginning with an 'L'
(for some reason this is allowed), our 4.1bsd makes an INTERNAL ERROR.
Repeat by:
	echo L:L: | /bin/as
(Yes, no more).
If you have the bug, you will get the message:
Assembler:
"<stdin>", line 2: INTERNAL ERROR: Wrote 0 symbols, wanted to write -1 symbols.

Here is a context diff:
*** /usr/src/cmd/as/asparse.c	Thu Nov  6 05:32:30 1980
--- asparse.c	Mon Jan 21 16:44:27 1985
***************
*** 162,167
  							dotp->e_xvalue);
  					}
  				}
  			}
  			np->s_type &= ~(XTYPE|XFORW);
  			np->s_type |= dotp->e_xtype;

--- 162,169 -----
  							dotp->e_xvalue);
  					}
  				}
+ 			} else if (passno == 1 && np->s_name[0] == 'L') {
+ 				nlabels++;
  			}
  			np->s_type &= ~(XTYPE|XFORW);
  			np->s_type |= dotp->e_xtype;
***************
*** 168,176
  			np->s_value = dotp->e_xvalue;
  			if (passno == 1){
  				np->s_index = dotp-usedot;
- 				if (np->s_name[0] == 'L'){
- 					nlabels++;
- 				}
  				np->s_tag = LABELID;
  			}
  		}	/*end of this being a label*/

--- 170,175 -----
  			np->s_value = dotp->e_xvalue;
  			if (passno == 1){
  				np->s_index = dotp-usedot;
  				np->s_tag = LABELID;
  			}
  		}	/*end of this being a label*/

				Duk Bekema
				...!{seismo|decvax|philabs}!mcvax!vu44!duk