struct clone fixed. 29/16529/2
authorCedric Delamarre <cedric.delamarre@scilab-enterprises.com>
Fri, 29 May 2015 09:10:48 +0000 (11:10 +0200)
committerVincent COUVERT <vincent.couvert@scilab-enterprises.com>
Fri, 29 May 2015 09:57:50 +0000 (11:57 +0200)
commitdc9ef985efc777e393d03a94dfe59b1b7bdfee9e
treea48d6a934ca504875e94e6c02aa050f46262b267
parent1c9bc810100cde6c2034eef3f555cb3ef454f52f
struct clone fixed.

* A struct cloned must have all SingleStruct reference set to 1
  because we cant increase reference of SingleStruct when we do it
  on a Struct.

z.y = 42;
y.o = z;

// here z is cloned, after extraction of z(1), two Struct
// contain the same SingleStruct with ref = 1 because of extraction without copy.
// When the temporary Struct "z(1)" is deleted, the SingleStruct is deleted too.
z(1).x=12;

Change-Id: I3b90752cdae7cdfe172bed30d8ad67959dc787f6
scilab/modules/ast/src/cpp/types/struct.cpp