gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] LENGTH() on Solaris 10/sparc


From: Gaius Mulley
Subject: Re: [Gm2] LENGTH() on Solaris 10/sparc
Date: Sat, 24 Jul 2010 08:48:01 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

john o goyo <address@hidden> writes:

> Examination of the failed test cases shows a real oddity.
>
> In a call to LENGTH(s), where s is a string, HIGH(s) is passed as
> zero and LENGTH(s) is always 1.
>
> Could you please answer the following to assist in my further inquiries:
>
> 1. Where is LENGTH() defined?

Hi John,

gm2/gm2-libs-iso/M2RTS.mod:Length for iso
gm2/gm2-libs/M2RTS.mod:Length for pim


> 2. How are open arrays passed on the stack?

a structure is passed on the stack which contains:

struct unbounded {
  char *startofstring;
  unsigned int high;
}

it would be interesting to single step the regression test
tstLength - and observe the string contents when LENGTH is invoked.
The test seems to expose problems with:

VAR
   s: ARRAY [1..5] OF CHAR ;
BEGIN
   s := 'What?' ;
   IF LENGTH(foo)...

I suspect the 1..5 is causing confusion somewhere - it would be
interesting to see if the test works if the lower bound were 0,

The other failures on the Solaris are to do with setjmp and longjmp
(which are not used in gm2).  Maybe I should remove them from the
regression tests and remove setjmp/longjmp (builtins) as they are
documented as being very restrictive,

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]