Return-Path: tex-live-bounces@tug.org
Return-Path: <tex-live-bounces@tug.org>
Received: from tug.org (tug.org [130.225.2.178])
	by jupiter.fsci.fuk.kindai.ac.jp (8.12.9/8.12.9) with ESMTP id i6EFrl1R021485
	for <kakuto@fsci.fuk.kindai.ac.jp>; Thu, 15 Jul 2004 00:53:48 +0900 (JST)
Received: from tug.org (localhost.localdomain [127.0.0.1])
	by tug.org (8.11.7-20030920/8.11.6) with ESMTP id i6EFrnX14341;
	Wed, 14 Jul 2004 17:53:49 +0200
Received: from mail.mppmu.mpg.de (mail.mppmu.mpg.de [134.107.24.11])
	by tug.org (8.11.7-20030920/8.11.6) with ESMTP id i6EFqeX14266;
	Wed, 14 Jul 2004 17:52:40 +0200
Received: by mail.mppmu.mpg.de (Postfix, from userid 1111)
	id D85D4BE7E; Wed, 14 Jul 2004 17:51:37 +0200 (CEST)
Received: from pcl321.mppmu.mpg.de (pcl321.mppmu.mpg.de [134.107.3.54])
	by mail.mppmu.mpg.de (Postfix) with ESMTP
	id C1B6ABE7E; Wed, 14 Jul 2004 17:51:37 +0200 (CEST)
Received: from pcl321.mppmu.mpg.de (localhost [127.0.0.1])
	by pcl321.mppmu.mpg.de (8.12.9/8.12.9) with ESMTP id i6EFpb5f008787;
	Wed, 14 Jul 2004 17:51:37 +0200
Received: from localhost (peb@localhost)
	by pcl321.mppmu.mpg.de (8.12.9/8.12.9/Submit) with ESMTP id
	i6EFpb3k008784; Wed, 14 Jul 2004 17:51:37 +0200
X-Authentication-Warning: pcl321.mppmu.mpg.de: peb owned process doing -bs
Date: Wed, 14 Jul 2004 17:51:37 +0200 (CEST)
From: Peter Breitenlohner <peb@mppmu.mpg.de>
To: Olaf Weber <olaf@infovore.xs4all.nl>
In-Reply-To: <87smbugarr.fsf@infovore.xs4all.nl>
Message-ID: <Pine.LNX.4.60.0407141727320.27913@pcl321.mppmu.mpg.de>
References: <40EECAA3.3010909@wxs.nl>
	<20040713145359.3eb46258@glenlivet.elvenkind.com>
	<Pine.LNX.4.60.0407131622150.27913@pcl321.mppmu.mpg.de>
	<Pine.LNX.4.60.0407131834560.27913@pcl321.mppmu.mpg.de>
	<40F415E8.4050408@Rhul.Ac.Uk>
	<87wu17g6i1.fsf@infovore.xs4all.nl> <87smbugarr.fsf@infovore.xs4all.nl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-DAIMI-Spam-Score: -100 () USER_IN_WHITELIST
X-Scanned-By: MIMEDefang 2.43
Cc: tex-live@tug.org, tex-implementors@tug.org
Subject: [tex-live] Re: [tex-implementors] bug in etex
X-BeenThere: tex-live@tug.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: "TeX Live development and testing." <tex-live.tug.org>
List-Unsubscribe: <http://tug.org/mailman/listinfo/tex-live>,
	<mailto:tex-live-request@tug.org?subject=unsubscribe>
List-Archive: <http://tug.org/mailman/private/tex-live>
List-Post: <mailto:tex-live@tug.org>
List-Help: <mailto:tex-live-request@tug.org?subject=help>
List-Subscribe: <http://tug.org/mailman/listinfo/tex-live>,
	<mailto:tex-live-request@tug.org?subject=subscribe>
Sender: tex-live-bounces@tug.org
Errors-To: tex-live-bounces@tug.org

On Wed, 14 Jul 2004, Olaf Weber wrote:

> In particular, it looks like the code
> .....
>    if cur_chr=mem_bot then
>      begin scan_register_num;
>      if cur_val<256 then q:=equiv(toks_base+cur_val)
>      else  begin find_sa_element(tok_val,cur_val,false);
>        if cur_ptr=null then q:=null
>        else q:=sa_ptr(cur_ptr);
>        end;
>      end
>    else q:=sa_ptr(cur_ptr)                               { <---1--- }
>  else q:=equiv(cur_chr);
> .....

Hi Olaf,

this was a stupid typo. The line (1) above should read
>   else q:=sa_ptr(cur_chr)
                        ^^^
and everything should be fine.

A completely analogous piece of code in etex.ch reads
>     if m=mem_bot then
>       begin scan_register_num;
>       if cur_val<256 then cur_val:=equiv(toks_base+cur_val)
>       else  begin find_sa_element(tok_val,cur_val,false);
>         if cur_ptr=null then cur_val:=null
>         else cur_val:=sa_ptr(cur_ptr);
>         end;
>       end
>     else cur_val:=sa_ptr(m)
>   else cur_val:=equiv(m);

Could you test this? Right now I have some difficulties recompiling etex.

Some explanation:
 	cur_cmd == toks_register && cur_chr != mem_bot
indicates a \toksdef'ed sparse array element (which can't disappear due to
its reference count) with cur_chr pointing to the actual array element.

The global variable cur_ptr should only be used in a very local context.

Referencing the (non-existing) \toks265 results in cur_ptr==null. Even
without that, i.e. with cur_ptr!=null the "q:=sa_ptr(cur_ptr)" gives a
wrong value!

regards
Peter Breitenlohner <peb@mppmu.mpg.de>

_______________________________________________
TeX Live mailing list
http://tug.org/mailman/listinfo/tex-live
