From 17639d13cf2a2eb7fd8029addd6c837deac75caa Mon Sep 17 00:00:00 2001 From: Cedric Delamarre Date: Tue, 15 Dec 2015 18:04:41 +0100 Subject: [PATCH] [bug_14300] double free fixed test_run ast bug_14300 test_run ast bug_14300 mode_nwni_profiling Change-Id: I87da365586b456224e4b6929b7ac064e54c92e8d --- scilab/CHANGES_6.0.X | 2 +- scilab/modules/ast/src/cpp/ast/runvisitor.cpp | 1 - .../ast/tests/nonreg_tests/bug_14300.dia.ref | 21 ++++++++++++++++++ .../modules/ast/tests/nonreg_tests/bug_14300.tst | 23 ++++++++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 scilab/modules/ast/tests/nonreg_tests/bug_14300.dia.ref create mode 100644 scilab/modules/ast/tests/nonreg_tests/bug_14300.tst diff --git a/scilab/CHANGES_6.0.X b/scilab/CHANGES_6.0.X index b524ccd..a603d6f 100644 --- a/scilab/CHANGES_6.0.X +++ b/scilab/CHANGES_6.0.X @@ -33,7 +33,7 @@ For a high-level overview of the changes in this release, please consult the "Wh * Bug #14257 fixed - English spelling in messages and in comments. -* Bug #14257 fixed - English spelling in messages and in comments. +* Bug #14300 fixed - Crash when playing with structures. Dependencies ============= diff --git a/scilab/modules/ast/src/cpp/ast/runvisitor.cpp b/scilab/modules/ast/src/cpp/ast/runvisitor.cpp index 8e23539..2ae8441 100644 --- a/scilab/modules/ast/src/cpp/ast/runvisitor.cpp +++ b/scilab/modules/ast/src/cpp/ast/runvisitor.cpp @@ -370,7 +370,6 @@ void RunVisitorT::visitprivate(const FieldExp &e) } catch (std::wstring & err) { - pValue->killMe(); CoverageInstance::stopChrono((void*)&e); throw InternalError(err.c_str(), 999, e.getTail()->getLocation()); } diff --git a/scilab/modules/ast/tests/nonreg_tests/bug_14300.dia.ref b/scilab/modules/ast/tests/nonreg_tests/bug_14300.dia.ref new file mode 100644 index 0000000..011598c --- /dev/null +++ b/scilab/modules/ast/tests/nonreg_tests/bug_14300.dia.ref @@ -0,0 +1,21 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2015 - Scilab Enterprises - Cedric Delamarre +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 14300 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/14300 +// +// <-- Short Description --> +// Crash when playing with structures. +clear s; +s.a.h = 1; +s.b.h = 2; +errmsg = msprintf(_("Unknown field : %s."), "h"); +assert_checkerror("s(:).h;", errmsg); +assert_checkerror("s(1)(:).h;", errmsg); diff --git a/scilab/modules/ast/tests/nonreg_tests/bug_14300.tst b/scilab/modules/ast/tests/nonreg_tests/bug_14300.tst new file mode 100644 index 0000000..9bf55e9 --- /dev/null +++ b/scilab/modules/ast/tests/nonreg_tests/bug_14300.tst @@ -0,0 +1,23 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2015 - Scilab Enterprises - Cedric Delamarre +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 14300 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/14300 +// +// <-- Short Description --> +// Crash when playing with structures. + +clear s; +s.a.h = 1; +s.b.h = 2; + +errmsg = msprintf(_("Unknown field : %s."), "h"); +assert_checkerror("s(:).h;", errmsg); +assert_checkerror("s(1)(:).h;", errmsg); -- 1.7.9.5