Path: utzoo!attcan!uunet!zephyr.ens.tek.com!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.lang.lisp.x Subject: Re: XLISP SAVE/RESTORE ??? Message-ID: <6958@tekgvs.LABS.TEK.COM> Date: 27 Feb 90 17:54:01 GMT References: <1973.25ea7b8e@cc.helsinki.fi> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 57 In article <1973.25ea7b8e@cc.helsinki.fi> stickler@cc.helsinki.fi writes: >Is there a fix for XLISP 2.x SAVE()/RESTORE() ? >My PC version (downloaded from BIX) saves without error, but >complains when restoring. There are three separate problems that affect version 2.0 and 2.1. (There are dozens of other bugs as well -- I mail out bugfixed sources upon receipt of a disk and stamped mailer) ******************* Problem: "restore" corrupts system. Diagnosis: argument stack not being reset -- initial garbage collect "marks" random memory! Solution: Add to "initialize" in xlirestore: xlfp = xlsp = xlargstkbase; *xlsp++ = NIL; ******************* Problem: "restore" corrupts system with 8086 compilers. Diagnosis: cvoptr is doing improper arithmetic. Solution: CVPTR in xlisp.h needs to be defined as #define CVPTR(x) ((((unsigned long)(x) >> 16) << 4) + ((unsigned) x)) return statement in cvoptr() (xlimage.c) needs to be changed from: return (off + (OFFTYPE)((p - seg->sg_nodes) << 1)); to: return (off+(((CVPTR(p)-CVPTR(seg->sg_nodes))/sizeof(struct node))<<1)); Note: for this to work with non-8086 compilers, the default for CVPTR should be changed from (x) to ((OFFTYPE)(x)). **************** BUG: Any attempt to do more than one RESTORE in a session causes the error "insufficient memory - segment". SOLUTION: In file xlimage.c, function freeimage(), change if (((fp = getfile(p)) != 0) && (fp != stdin && fp != stdout)) to: if (((fp = getfile(p)) != 0) && (fp != stdin && fp != stdout && fp != stderr)) ============================= Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply