From 41524cc993166aaa2f8164144894ff976a3c6b37 Mon Sep 17 00:00:00 2001 From: Mark Linton Date: Tue, 15 Feb 1983 07:28:38 -0800 Subject: [PATCH] changed the way the INDEX operator is evaluated to better SCCS-vsn: usr.bin/pascal/pdx/tree/eval.c 1.10 --- usr/src/usr.bin/pascal/pdx/tree/eval.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr/src/usr.bin/pascal/pdx/tree/eval.c b/usr/src/usr.bin/pascal/pdx/tree/eval.c index 5d3cedb895..beb3608eb3 100644 --- a/usr/src/usr.bin/pascal/pdx/tree/eval.c +++ b/usr/src/usr.bin/pascal/pdx/tree/eval.c @@ -1,6 +1,6 @@ /* Copyright (c) 1982 Regents of the University of California */ -static char sccsid[] = "@(#)eval.c 1.9 %G%"; +static char sccsid[] = "@(#)eval.c 1.10 %G%"; /* * Parse tree evaluation. @@ -108,11 +108,11 @@ register NODE *p; } case O_INDEX: { - int n; - long i; + long n; /* base address for array */ + long i; /* index - lower bound */ n = pop(long); - i = evalindex(p->left->nodetype, popsmall(p->right->nodetype)); + i = evalindex(p->left->nodetype, p->right); push(long, n + i*size(p->nodetype)); break; } -- 2.20.1