octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #46660] object array writing into class member


From: anonymous
Subject: [Octave-bug-tracker] [bug #46660] object array writing into class member alters another class member
Date: Fri, 5 Aug 2016 08:02:48 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

Follow-up Comment #5, bug #46660 (project octave):

well i think now we have to many fields.

waiting for the fix i have compiled the current mercurial snapshot with the
bugfix present. after running the code i get an testclass object with
dimension 2x2 (four integer fields for x and four integer fields for y):

>> a(1).x
ans = [](0x0)
>> a(2).x
ans = [](0x0)
>> a(3).x
ans = [](0x0)
>> a(4).x
ans =  123
>> a(1).y
ans = [](0x0)
>> a(2).y
ans = [](0x0)
>> a(3).y
ans = [](0x0)
>> a(4).y
ans =  321

as a comparison to the version 4.0.1 which comes with fedora the same code
results in an testclassobject of 1x2: 

>> a(1).x
ans = [](0x0)
>> a(2).x
ans = [](0x0)
>> a(3).x
error: A(I): index out of bounds; value 3 out of bound 2
>> a(1).y
ans = [](0x0)
>> a(2).y
ans =  321
>> a(3).y
error: A(I): index out of bounds; value 3 out of bound 2

note1: i am running the code from script (!) and the error is still present as
you can see a(2).x equals zero but should be 123! so i can't confirm that
running from script will protect you from the problem.

note2: the correct definition is 1x2 because testclass contains only two
integers (x and y). in the code an array is created with two testclass
members. hence we can only have four integers in total counting x and y.

best regards and thanks to the team!


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46660>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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