From 1ca8e497bbde5b9fbebb1a5c3535341c5b7cf4a9 Mon Sep 17 00:00:00 2001 From: Sylvain GENIN Date: Tue, 12 May 2015 15:45:47 +0200 Subject: [PATCH] Xlist integrated in another Xlist need to be copied to perform an affectation example : value = mlist(["test", "NAMES", "VALUES", "DATE"], ... "a", ... ones(2,2), ... ones(2,2)); data=tlist(["test", "DATA", "PT"], ones(4,1), value); test = data; data.PT.NAMES = "b" ; data.PT.NAMES test.PT.NAMES Change-Id: Ia7c7b1bf1f5747f73300808a1833333ccc1f1b60 --- scilab/modules/ast/src/cpp/types/list.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scilab/modules/ast/src/cpp/types/list.cpp b/scilab/modules/ast/src/cpp/types/list.cpp index 909ad57..a0ac52a 100644 --- a/scilab/modules/ast/src/cpp/types/list.cpp +++ b/scilab/modules/ast/src/cpp/types/list.cpp @@ -98,7 +98,14 @@ int List::getSize() */ void List::append(InternalType *_typedValue) { - m_plData->push_back(_typedValue); + if (_typedValue->isList()) + { + m_plData->push_back(_typedValue->clone()); + } + else + { + m_plData->push_back(_typedValue); + } m_plData->back()->IncreaseRef(); m_iSize = static_cast(m_plData->size()); } -- 1.7.9.5