[comp.lang.perl] perl v3pl18 on FPS 500

kai@sp1.csrd.uiuc.edu (Kuck And Associates) (07/25/90)

This message is for FPS 500 perl users.

To get Perl version 3 patchlevel 18 to execute correctly on our FPS 500 running
FPX 4.1.25 I had to do two things.  First, I applied the same patch that
Kian-Tat Lim (ktl@wagvax.caltech.edu) posted last January to get Perl v3pl8
working, and additionally, the "-J" C compiler switch had to be used to compile
perl (just answer the "Configure" question about additional "cc" options with
"-J").  With these two changes, Perl v3pl18 passes all it's tests, and my Perl
scripts run correctly.


Here's that patch again:

/* Written  8:19 pm  Jan  4, 1990 by ktl@wag240.caltech.edu in kailand:comp.sources.bugs */
/* ---------- "Perl 3.0 PL 8 triggers compiler bug" ---------- */
Description:

	Some compilers may produce incorrect code for the large switch (*s)
in toke.c.  In particular, it is essential that characters with the high
bit set be handled properly.  If this is not the case, failures (most likely
accompanied by core dumps) will be experienced on comp.package, cmd.subval,
io.print, op.dbm, op.index, op.mkdir, op.pack, op.read, op.sort, op.substr,
and op.vec due to mishandling of sort, return, printf, and print followed
by a parenthesized expression.

Repeat-By:

	On an FPS 500 running FPX 4.1.0, make perl and do a 'make test'.
On this system, the compiler generates a jump table for the switch but
fails to properly bounds check the character being switched on.

Fix:

*** toke.c.old	Thu Jan  4 17:57:02 1990
--- toke.c	Thu Jan  4 17:56:36 1990
***************
*** 154,159 ****
--- 154,168 ----
  	else
  	    fprintf(stderr,"Tokener at %s\n",s);
  #endif
+ #ifdef accel
+     if (*s & 128) {
+ 	if ((*s & 127) == '(')
+ 	    *s++ = '(';
+ 	else
+ 	    warn("Unrecognized character \\%03o ignored", *s++);
+ 	goto retry;
+     }
+ #endif
      switch (*s) {
      default:
  	if ((*s & 127) == '(')

--
Kian-Tat Lim (ktl@wagvax.caltech.edu, KTL @ CITCHEM.BITNET, GEnie: K.LIM1)
/* End of text from kailand:comp.sources.bugs */



	Patrick Wolfe   (pat@kai.com, kailand!pat)
	System Programmer/Operations Manager, Kuck & Associates
	"Any opinions expressed are my own, not my employers's.
	 Please don't call my boss and complain ... again."

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (07/26/90)

In article <1990Jul25.155526.4213@csrd.uiuc.edu> kai@sp1.csrd.uiuc.edu (Kuck And Associates) writes:
: Here's that patch again:
: 
: /* Written  8:19 pm  Jan  4, 1990 by ktl@wag240.caltech.edu in kailand:comp.sources.bugs */
: /* ---------- "Perl 3.0 PL 8 triggers compiler bug" ---------- */
: Description:
: 
: 	Some compilers may produce incorrect code for the large switch (*s)
: in toke.c.  In particular, it is essential that characters with the high
: bit set be handled properly.  If this is not the case, failures (most likely
: accompanied by core dumps) will be experienced on comp.package, cmd.subval,
: io.print, op.dbm, op.index, op.mkdir, op.pack, op.read, op.sort, op.substr,
: and op.vec due to mishandling of sort, return, printf, and print followed
: by a parenthesized expression.

I'll include this patch in the next official patch, except that I've changed
the #ifdef accel to #ifdef BADSWITCH, and you'll have to say -DBADSWITCH.
Other compilers may have the same problem.

Larry