From: Cedric Delamarre Date: Mon, 17 Jul 2017 14:44:05 +0000 (+0200) Subject: [bug_15037] residu fixed X-Git-Tag: 6.0.1~256 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=872b1758394b15cb7d72e4bfb99e7b7d9e8899c8 [bug_15037] residu fixed test_run cacsd bug_15037 test_run cacsd bug_15037 mode_nwni_profiling Change-Id: I2554f03563b9b10fca06c37e99381ec1bad704fb --- diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index c166aea..94fbbf6 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -366,6 +366,7 @@ the [development mailing list](dev@lists.scilab.org) for a particular toolbox. * [#15019](http://bugzilla.scilab.org/show_bug.cgi?id=15019): Add 'csci6' in the calling of ilib_build in 'Getting started with API_Scilab' help page. * [#15023](http://bugzilla.scilab.org/show_bug.cgi?id=15023): `clf()` wrongly reset `figure_id`. * [#15024](http://bugzilla.scilab.org/show_bug.cgi?id=15024): Xcos labels were not preserved at diagram compilation. +* [#15037](http://bugzilla.scilab.org/show_bug.cgi?id=15037): the residu function may crash Scilab6. * [#15039](http://bugzilla.scilab.org/show_bug.cgi?id=15039): Added demos to showcase Xcos' new graphical features * [#15046](http://bugzilla.scilab.org/show_bug.cgi?id=15046): `call` couldn't mix inputs and outputs * [#15052](http://bugzilla.scilab.org/show_bug.cgi?id=15052): `getpid` wasn't available anymore diff --git a/scilab/modules/cacsd/sci_gateway/cpp/sci_residu.cpp b/scilab/modules/cacsd/sci_gateway/cpp/sci_residu.cpp index fd75b41..e9daec3 100644 --- a/scilab/modules/cacsd/sci_gateway/cpp/sci_residu.cpp +++ b/scilab/modules/cacsd/sci_gateway/cpp/sci_residu.cpp @@ -145,11 +145,8 @@ types::Function::ReturnValue sci_residu(types::typed_list &in, int _iRetCount, t int iErr = 0; double v = 0; - int iSize1 = piRank[0][i] + 1; - int iSize2 = piRank[1][i] + 1; - int iSize3 = piRank[2][i] + 1; - C2F(residu)(pdblInR[0][i], &iSize1, pdblInR[1][i], &iSize2, - pdblInR[2][i], &iSize3, &v, &dblEps, &iErr); + C2F(residu)(pdblInR[0][i], piRank[0]+i, pdblInR[1][i], piRank[1]+i, + pdblInR[2][i], piRank[2]+i, &v, &dblEps, &iErr); if (iErr) { Scierror(78, _("%s: An error occured in '%s'.\n"), "residu", "residu"); diff --git a/scilab/modules/cacsd/tests/nonreg_tests/bug_15037.dia.ref b/scilab/modules/cacsd/tests/nonreg_tests/bug_15037.dia.ref new file mode 100644 index 0000000..74d8449 --- /dev/null +++ b/scilab/modules/cacsd/tests/nonreg_tests/bug_15037.dia.ref @@ -0,0 +1,20 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2017 - ESI-Group - Cedric Delamarre +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 14980 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=15037 +// +// <-- Short Description --> +// the residu function may crash Scilab +a=1-%s^2; +b=1+2*%s+3*%s^2; +c=1-2*%s+3*%s^2; +assert_checkequal(residu(a,b,c), 1/3); diff --git a/scilab/modules/cacsd/tests/nonreg_tests/bug_15037.tst b/scilab/modules/cacsd/tests/nonreg_tests/bug_15037.tst new file mode 100644 index 0000000..5ccb174 --- /dev/null +++ b/scilab/modules/cacsd/tests/nonreg_tests/bug_15037.tst @@ -0,0 +1,21 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2017 - ESI-Group - Cedric Delamarre +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 14980 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=15037 +// +// <-- Short Description --> +// the residu function may crash Scilab + +a=1-%s^2; +b=1+2*%s+3*%s^2; +c=1-2*%s+3*%s^2; +assert_checkequal(residu(a,b,c), 1/3);