[abc-users] Small bug in polyglot

From: Eric Bodden <eric@bodden.de>
Date: Tue Jan 04 2005 - 15:44:28 GMT

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

By accident I found a small bug in polyglot, you maybe should be
aware of. ABC does not yet make use of the affected method, but it
might in the future, so I thought it might be worthwhile forwarding
that to you...

Eric

Nate Nystrom wrote:
> On Jan 4, 2005, at 09:23, Eric Bodden wrote:
>> Hi.
>>
>> I am not sure if that is a bug or I am just not understanding your
>> extension model correctly... As far as I understood, in Polyglot,
>> each node can have an extension ext(), which can extensions
>> themselves.
>> So if for a given node n I call n.ext(3), this should be equal to
>> n.ext().ext().ext(), shouldn't it?
>>
>> When I not look at the implementation of Node_c...
>>
>> public Ext ext(int n) {
>> if (n < 1) throw new InternalCompilerError("n must be >=
>> 1");
>> if (n == 1) return ext();
>> return ext(n-1);
>> }
>>
>> ... it seems to me that n.ext(3) calls n.ext(2) calls n.ext(1)
>> returning n.ext(), so n.ext(i)==n.ext() for all i>=1. This is not
>> what it's supposed to do, is it?
>
> You're right. It should be:
>
> return ext(n-1).ext();
>
> I'm not sure how that slipped by. I've checked the fix into cvs
> and it should appear in the next release.
>
> Thanks,
> Nate

- --
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQdq528wiFCm7RlWCEQLNZgCgvDwDBPw7qRKgwD1oVXU2FQrGVh8AoKq2
BkgNxubkCE52ymSRXWSIXn23
=vY2v
-----END PGP SIGNATURE-----
Received on Tue Jan 4 15:44:40 2005

This archive was generated by hypermail 2.1.8 : Fri Jan 07 2005 - 01:30:04 GMT