[Oberon] Bug? procedure variable in procedure call parameter

Volkert Barr volkert at nivoba.de
Tue Apr 1 06:53:25 CEST 2014


With the latest Image (from 28.03.2014 timestamp) the whole system crashes. But as i understand 
your reply, it is a bug.

BW,
Volkert

On 31.03.2014, at 20:22, Peter De Wachter <pdewacht at gmail.com> wrote:

> There were serious bugs with floating point code in the image and in the
> emulator. That's probably the cause of your problem. Paul Reed published
> a fixed image last Friday and the emulator bugs are fixed in the current
> revision.
> 
> On 31-03-14 19:17, Volkert Barr wrote:
>> Dear all,
>> 
>> i have a "problem" with the evaluation of a "procedure variable" used as parameter in a procedure call.
>> 
>> this case leads to a ABORT or TRAP in Line 1. Procedure variable is FunId.
>> 
>> BEGIN
>> (*1*) Texts.WriteRealFix(W, FunId(1.0), 5,3);
>>  ...
>> END...
>> 
>> this case with the dummy assigment to "Test" gives the correct output
>> BEGIN
>>  Test := FunId(1.0);	
>>  Texts.WriteRealFix(W, FunId(1.0), 5,3);
>>  ...
>> END...
>> 
>> The complete code can be found in the appended Module
>> 
>> Bug or Feature??
>> 
>> I use the Oberon-Image (RISC.IMG) from Paul Reed´s "Project Oberon"-Website with the nice "Oberon RISC Emulator" from Peter De Wachter (thanks for it).
>> 
>> BW,
>> Volkert
>> ----
>> 
>> MODULE Scratch;
>> IMPORT Texts, Oberon;
>> 
>>    TYPE Function = PROCEDURE (x:REAL) : REAL;
>> 
>>    VAR W: Texts.Writer;
>> 	FunId : Function;
>> 
>>    PROCEDURE RealId(x:REAL):REAL;
>>    BEGIN
>>        RETURN x
>>    END RealId;
>> 
>> 
>>    PROCEDURE DoIt*;
>>    VAR
>> 	Test : REAL;
>>    BEGIN
>> 	Test := FunId(1.0);			
>> 	Texts.WriteRealFix(W, FunId(1.0), 5,3);
>> 	Texts.WriteRealFix(W, RealId(1.0), 5,3);
>> 	Texts.WriteLn(W);
>> 	Texts.Append(Oberon.Log, W.buf)
>>    END DoIt;
>> 
>> BEGIN Texts.OpenWriter(W);
>>      FunId := RealId;
>> END Scratch.
>> 
>> 
>> 
>> --
>> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
>> https://lists.inf.ethz.ch/mailman/listinfo/oberon
> 
> 
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon

--
Volkert Barr
www.nivoba.de

"The more complex an object, the larger the investment in learning to use it, and the greater the resistance to abandon it."




More information about the Oberon mailing list