gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Is this a bug?


From: Gaius Mulley
Subject: Re: [Gm2] Is this a bug?
Date: 12 Oct 2004 10:23:50 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"John B. Wallace, Jr." <address@hidden> writes:

> This code produces an unexpected result:
> 
> 
> MODULE StrAssignTest;
>  
> FROM StrIO IMPORT WriteString, WriteLn;
>  
> TYPE
>   String = ARRAY [0..255] OF CHAR;
>  
> VAR
>   Str : String;
>  
> BEGIN
>   Str := 'abcdefghij';
>   WriteString(Str);
>   WriteLn;
>   Str := '1234';
>   WriteString(Str);
>   WriteLn
> END StrAssignTest.
> 
> 
> On my system the output is:
> 
> abcdefghij
> 1234efghij
> 
> 
> John

Hi,

yes it is a bug, here is the bug fix:

diff -r1.38 M2GenGCC.mod
643,644c643,644
<    FindSize - given a Modula-2 symbol, sym, return the GCC Tree (constant) 
representing
<               the storage size in bytes.
---
>    FindSize - given a Modula-2 symbol, sym, return the GCC Tree
>               (constant) representing the storage size in bytes.
1789a1790,1798
>       PushIntegerTree(FindSize(op3)) ;
>       PushIntegerTree(FindSize(op1)) ;
>       IF Less(CurrentQuadToken)
>       THEN
>          (* there is room for the extra <nul> character *)
>          t := BuildAdd(FindSize(op3), GetIntegerOne(), FALSE)
>       ELSE
>          t := FindSize(op3)
>       END ;
1792c1801
<                                                FindSize(op3)))
---
>                                                t))


I'll check this patch into CVS later today,

Thanks Gaius



reply via email to

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