Message from discussion
[PATCH] Keyed access
Newsgroups: perl.perl6.internals
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <l...@toetsch.at>
Mailing-List: contact perl6-internals-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-intern...@perl.org
Message-ID: <3D6346A6.3080306@toetsch.at>
Date: Wed, 21 Aug 2002 09:52:06 +0200
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011129
X-Accept-Language: en-us
MIME-Version: 1.0
To: Mike Lambert <pe...@jall.org>
Cc: Tom Hughes <t...@compton.nu>, perl6-intern...@perl.org
Subject: Re: [perl #16274] [PATCH] Keyed access
References: <Pine.LNX.4.44.0208210230350.16391-100000@jall.org>
Content-Type: multipart/mixed;
boundary="------------050904020207080203060901"
Approved: n...@nntp.perl.org
From: l...@toetsch.at (Leopold Toetsch)
Lines: 73
--------------050904020207080203060901
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Mike Lambert wrote:
> Anyways, cd to languages/BASIC, run basic.pl, type "LOAD wumpus", and
> watch it die on "Not a string!".
Tracing this beast down, needs attached patch, to cut displayed arg strings.
BTW trace.c nether frees this escaped string.
The last instruction executed is:
PC=1457; OP=102 (set_p_ki_s); ARGS=(P22=0x81565d4, [I1=1], S0="1 REM
Taken from
David Ahl's 101 BASIC G...")
Not a string!
.... where actually the hash key I1 is not a string.
AFAIK this behaviour is intended.
The key patch is working fine, all perl6 tests succeed as before.
leo
--------------050904020207080203060901
Content-Type: text/plain;
name="debug.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="debug.c.diff"
--- debug.c Tue Aug 20 07:06:07 2002
+++ /home/lt/src/parrot-007/debug.c Wed Aug 21 09:39:42 2002
@@ -497,10 +497,19 @@
{
const char *end = string + length;
char *new,*fill;
+ int cut = 0;
+#define DISP_LEN 40
/* Return if there is no string to escape*/
if (!string || !*string)
return NULL;
+ /* if string is too long, cut it */
+ if (length > DISP_LEN) {
+ length = DISP_LEN;
+ end = string + length;
+ cut = 1;
+ length += 2;
+ }
fill = new = (char *)mem_sys_allocate(length * 2 + 1);
@@ -539,6 +548,11 @@
break;
}
}
+ if (cut) {
+ *(fill++) = '.';
+ *(fill++) = '.';
+ *(fill++) = '.';
+ }
*fill = '\0';
return new;
}
--------------050904020207080203060901--