rmdel -r1.13
authorKirk McKusick <mckusic@ucbvax.Berkeley.EDU>
Thu, 16 Jul 1981 06:58:41 +0000 (22:58 -0800)
committerKirk McKusick <mckusic@ucbvax.Berkeley.EDU>
Thu, 16 Jul 1981 06:58:41 +0000 (22:58 -0800)
SCCS-vsn: usr.bin/pascal/px/interp.c 1.15

usr/src/usr.bin/pascal/px/interp.c

index 35476ea..406afb0 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)interp.c 1.14 %G%";
+static char sccsid[] = "@(#)interp.c 1.15 %G%";
 
 #include <math.h>
 #include "whoami.h"
 
 #include <math.h>
 #include "whoami.h"
@@ -217,6 +217,7 @@ interpreter(base)
                        continue;
                case O_FCALL:
                        pc.cp++;
                        continue;
                case O_FCALL:
                        pc.cp++;
+                       tcp = popaddr(); /* ptr to display save area */
                        tfp = (struct formalrtn *)popaddr();
                        stp = (struct stack *)
                                pushsp((long)(sizeof(struct stack)));
                        tfp = (struct formalrtn *)popaddr();
                        stp = (struct stack *)
                                pushsp((long)(sizeof(struct stack)));
@@ -226,7 +227,7 @@ interpreter(base)
                        pc.cp = tfp->fentryaddr;/* calc new entry point */
                        _dp = &_display.frame[tfp->fbn];/* new display ptr */
                        blkcpy(tfp->fbn * sizeof(struct disp),
                        pc.cp = tfp->fentryaddr;/* calc new entry point */
                        _dp = &_display.frame[tfp->fbn];/* new display ptr */
                        blkcpy(tfp->fbn * sizeof(struct disp),
-                               &_display.frame[1], &tfp->fdisp[tfp->fbn]);
+                               &_display.frame[1], tcp);
                        blkcpy(tfp->fbn * sizeof(struct disp),
                                &tfp->fdisp[0], &_display.frame[1]);
                        continue;
                        blkcpy(tfp->fbn * sizeof(struct disp),
                                &tfp->fdisp[0], &_display.frame[1]);
                        continue;
@@ -236,13 +237,16 @@ interpreter(base)
                                tl = *pc.usp++;
                        tcp = pushsp((long)(0));
                        tfp = *(struct formalrtn **)(tcp + tl);
                                tl = *pc.usp++;
                        tcp = pushsp((long)(0));
                        tfp = *(struct formalrtn **)(tcp + tl);
+                       tcp1 = *(char **)
+                           (tcp + tl + sizeof(struct formalrtn *));
                        if (tl != 0) {
                        if (tl != 0) {
-                               blkcpy(tl, tcp,
-                                   tcp + sizeof(struct formalrtn *));
+                               blkcpy(tl, tcp, tcp + sizeof(struct formalrtn *)
+                                   + sizeof(char *));
                        }
                        }
-                       popsp((long)(sizeof(struct formalrtn *)));
+                       popsp((long)
+                           (sizeof(struct formalrtn *) + sizeof (char *)));
                        blkcpy(tfp->fbn * sizeof(struct disp),
                        blkcpy(tfp->fbn * sizeof(struct disp),
-                           &tfp->fdisp[tfp->fbn], &_display.frame[1]);
+                           tcp1, &_display.frame[1]);
                        continue;
                case O_FSAV:
                        tfp = (struct formalrtn *)popaddr();
                        continue;
                case O_FSAV:
                        tfp = (struct formalrtn *)popaddr();