bugModula-2 Compiler and Translator - Bugs: bug #43286, Nested functio calls fail

 
 

bug #43286: Nested functio calls fail

Submitted by:  Peter De Wachter <pdewacht>
Submitted on:  Tue 23 Sep 2014 11:21:53 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 24 Feb 2015 10:56:15 PM UTC, comment #6:

Compiling my simpler version of Peter's program with 'm2c -C -all' exposes C double assigning variables, thus losing parameter values when nested:

(par_WriteCard_InOut._x=((par_add_Bug._i=(11),par_add_Bug._j=((par_add_Bug._i=(100),par_add_Bug._j=(1000),_add_Bug(&par_add_Bug))),_add_Bug(&par_add_Bug))),par_WriteCard_InOut._n=(0),_WriteCard_InOut(&par_WriteCard_InOut));

David Egan Evans <sinuhe>
Project Administrator
Mon 22 Dec 2014 01:32:50 AM UTC, comment #5:

This returns 1200:

InOut.WriteInt(add(11, add(100, 1000)), 0);

This returns 1111:

InOut.WriteInt(add(add(1, 10), 1100), 0);

David Egan Evans <sinuhe>
Project Administrator
Fri 14 Nov 2014 06:49:57 PM UTC, comment #4:

Thanks and sorry. My mistake.

I used the search box to the left of the screen and it had/has an option "bugs", which, as it turns out, is global, not project specific.

The Free Software Foundation seems to do a very remarkable and important job, but I think that sometimes they should pay more attention to the quality of their products. May be the approach "less, but better" might help them.

I'll try to resubmit the flaw report to the Octave flaw-track.

Thanks again for Your helpful comment. :-)

Martin Vahi <martin_vahi>
Fri 14 Nov 2014 12:00:45 PM UTC, comment #3:

Martin, you seem to be talking about a problem with Octave. You're reporting it in the wrong place, this project is about m2c, a Modula-2 compiler. For instructions on reporting on Octave, see https://www.gnu.org/software/octave/bugs.html .

Peter De Wachter <pdewacht>
Thu 13 Nov 2014 10:07:00 PM UTC, comment #2:

Sorry, the mark-up collided with the code in my previous comment. Hopefully this is a bit better:

---restatement--start----
May be it's a different flaw, but the plotting of

y=sin(x)+sin(x+4 * sin(x))

works and the plotting of

y=sin(x)+sin(x Y 4 * sin(x))

where the Y is a star, id est multiplication,
did not work.
---restatement--end------

Martin Vahi <martin_vahi>
Thu 13 Nov 2014 10:03:01 PM UTC, comment #1:

May be it's a different flaw, but the plotting of

y=sin(x)+sin(x+4*sin(x))

works and the plotting of

y=sin(x)+sin(x4sin(x))

does not work.

---verbatim--start----
octave:7> x=-10:0.1:10;
octave:8> plot(x,sin(x)+sin(x+4*sin(x)));
octave:9> plot(x,sin(x)+sin(x4sin(x)));
error: operator *: nonconformant arguments (op1 is 1x201, op2 is 1x201)
error: evaluating argument list element number 1
error: evaluating argument list element number 2
octave:9>
---verbatim--end------

Anonymous
Tue 23 Sep 2014 11:21:53 PM UTC, original submission:

Consider the program below. It should output "1111", but the actual output is "1200". This is related to, but not the same as, Debian bug #168588.

MODULE Bug;
IMPORT InOut;

PROCEDURE add(i, j: INTEGER): INTEGER;
BEGIN RETURN i + j
END add;

BEGIN
InOut.WriteInt(add(add(1, 10), add(100, 1000)), 0);
InOut.WriteLn;
END Bug.

Peter De Wachter <pdewacht>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sinuhe (Posted a comment)
  • -unavailable- added by pdewacht (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 30 Apr 2015 10:18:05 PM UTCsinuheCarbon-CopyRemoved 97442=>-
    Thu 30 Apr 2015 10:13:46 PM UTCsinuheStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1