🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #170

Re: Perl 3.0 dumps core on write(); patch

#170
From: Larry Wall
Date: Thu, 14 Sep 1989 18:27
55 lines
1961 bytes
In article <399@wrkof.UUCP> win@incom.de (Winfried Koenig) writes:
: --------------
: On my Interactive UNIX Rel. 2.0.2  Perl 3.0 dumps core
: on the command:
: 
: write();	# no filehandle, write to stdout
: 
: With my patch for eval.c it seems to work.
: ... 
: --------------
: *** eval.c.dist	Wed Sep  6 02:36:05 1989
: --- eval.c	Tue Sep 12 19:07:00 1989
: ***************
: *** 409,415 ****
:   	STABSET(str);
:   	break;
:       case O_WRITE:
: ! 	if (maxarg == 0)
:   	    stab = defoutstab;
:   	else if ((arg[1].arg_type & A_MASK) == A_WORD)
:   	    stab = arg[1].arg_ptr.arg_stab;
: --- 409,415 ----
:   	STABSET(str);
:   	break;
:       case O_WRITE:
: ! 	if (maxarg == 1)
:   	    stab = defoutstab;
:   	else if ((arg[1].arg_type & A_MASK) == A_WORD)
: 

A more correct patch would be:

*** eval.c.old	Wed Sep 13 13:20:22 1989
--- eval.c	Wed Sep 13 13:24:10 1989
***************
*** 415,422 ****
      case O_WRITE:
  	if (maxarg == 0)
  	    stab = defoutstab;
! 	else if ((arg[1].arg_type & A_MASK) == A_WORD)
! 	    stab = arg[1].arg_ptr.arg_stab;
  	else
  	    stab = stabent(str_get(st[1]),TRUE);
  	if (!stab_io(stab)) {
--- 415,424 ----
      case O_WRITE:
  	if (maxarg == 0)
  	    stab = defoutstab;
! 	else if ((arg[1].arg_type & A_MASK) == A_WORD) {
! 	    if (!(stab = arg[1].arg_ptr.arg_stab))
! 		stab = defoutstab;
! 	}
  	else
  	    stab = stabent(str_get(st[1]),TRUE);
  	if (!stab_io(stab)) {
Technical Details
Message-ID: <6040@jpl-devvax.JPL.NASA.GOV>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!jpl-devvax!lwall
References: <399@wrkof.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!jpl-devvax!lwall
From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Newsgroups: comp.sources.bugs
Subject: Re: Perl 3.0 dumps core on write(); patch
Message-ID: <6040@jpl-devvax.JPL.NASA.GOV>
Date: 14 Sep 89 18:27:08 GMT
References: <399@wrkof.UUCP>
Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Organization: Jet Propulsion Laboratory, Pasadena, CA
Lines: 55