summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorAdeline CARNIS <adeline.carnis@scilab-enterprises.com>2016-09-12 13:55:54 +0200
committerAntoine ELIAS <antoine.elias@scilab-enterprises.com>2016-11-04 14:51:44 +0100
commit24209523b46350cd9b9f0b37b63a97a47d1d9d27 (patch)
treef7d66034ae54fb560553621e16f4f93191d26b9f /scilab
parentf977d1c899ff41315700c441ddc43095fd954727 (diff)
downloadscilab-24209523b46350cd9b9f0b37b63a97a47d1d9d27.zip
scilab-24209523b46350cd9b9f0b37b63a97a47d1d9d27.tar.gz
* Bug #14553 fixed - find(a=b) crashed Scilab.
Change-Id: I23da1745c64f6ad262743444efac9413504290d5
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md1
-rw-r--r--scilab/modules/boolean/sci_gateway/cpp/sci_find.cpp3
-rw-r--r--scilab/modules/boolean/tests/nonreg_tests/bug_14553.dia.ref21
-rw-r--r--scilab/modules/boolean/tests/nonreg_tests/bug_14553.tst21
4 files changed, 45 insertions, 1 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 57827bc..243ffb8 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -355,6 +355,7 @@ Bug Fixes
355* [#14461](http://bugzilla.scilab.org/show_bug.cgi?id=14461): Calling `grand(n, "markov", P, x0)` did not return all outputs. 355* [#14461](http://bugzilla.scilab.org/show_bug.cgi?id=14461): Calling `grand(n, "markov", P, x0)` did not return all outputs.
356* [#14513](http://bugzilla.scilab.org/show_bug.cgi?id=14513): `isqual` comparing two built-in functions yielded an error. 356* [#14513](http://bugzilla.scilab.org/show_bug.cgi?id=14513): `isqual` comparing two built-in functions yielded an error.
357* [#14527](http://bugzilla.scilab.org/show_bug.cgi?id=14527): Calling pathconvert function without parameters crashed Scilab. 357* [#14527](http://bugzilla.scilab.org/show_bug.cgi?id=14527): Calling pathconvert function without parameters crashed Scilab.
358* [#14553](http://bugzilla.scilab.org/show_bug.cgi?id=14553): find(a=b) crashed Scilab.
358* [#14557](http://bugzilla.scilab.org/show_bug.cgi?id=14557): `csim` failed when the system has no state. 359* [#14557](http://bugzilla.scilab.org/show_bug.cgi?id=14557): `csim` failed when the system has no state.
359* [#14564](http://bugzilla.scilab.org/show_bug.cgi?id=14564): fieldnames failed for empty structs. 360* [#14564](http://bugzilla.scilab.org/show_bug.cgi?id=14564): fieldnames failed for empty structs.
360* [#14582](http://bugzilla.scilab.org/show_bug.cgi?id=14582): `gettext`or it alias `_()` were sometimes applied to broken literal strings 361* [#14582](http://bugzilla.scilab.org/show_bug.cgi?id=14582): `gettext`or it alias `_()` were sometimes applied to broken literal strings
diff --git a/scilab/modules/boolean/sci_gateway/cpp/sci_find.cpp b/scilab/modules/boolean/sci_gateway/cpp/sci_find.cpp
index 3ff53ab..6c44c82 100644
--- a/scilab/modules/boolean/sci_gateway/cpp/sci_find.cpp
+++ b/scilab/modules/boolean/sci_gateway/cpp/sci_find.cpp
@@ -33,7 +33,8 @@ static void getCoordFromIndex(int _iIndex, int* _piIndexes, int* _piDims, int _i
33types::Function::ReturnValue sci_find(types::typed_list &in, int _iRetCount, types::typed_list &out) 33types::Function::ReturnValue sci_find(types::typed_list &in, int _iRetCount, types::typed_list &out)
34{ 34{
35 int iMax = -1; 35 int iMax = -1;
36 if (in.size() > 2) 36
37 if (in.size() == 0 || in.size() > 2)
37 { 38 {
38 Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected.\n"), "find", 1, 2); 39 Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected.\n"), "find", 1, 2);
39 return types::Function::Error; 40 return types::Function::Error;
diff --git a/scilab/modules/boolean/tests/nonreg_tests/bug_14553.dia.ref b/scilab/modules/boolean/tests/nonreg_tests/bug_14553.dia.ref
new file mode 100644
index 0000000..ff82af6
--- /dev/null
+++ b/scilab/modules/boolean/tests/nonreg_tests/bug_14553.dia.ref
@@ -0,0 +1,21 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises - Adeline CARNIS
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- CLI SHELL MODE -->
8//
9// <-- Non-regression test for bug 14553 -->
10//
11// <-- Bugzilla URL -->
12// http://bugzilla.scilab.org/show_bug.cgi?id=14553
13//
14// <-- Short Description -->
15// find(a=b) crashed Scilab.
16a = 3;
17b = 5;
18someStr = "find(a = b)";
19assert_checkfalse(execstr(someStr, "errcatch") == 0);
20refMsg = msprintf(_("%s: Wrong number of input argument(s): %d to %d expected.\n"), "find", 1, 2);
21assert_checkerror(someStr, refMsg);
diff --git a/scilab/modules/boolean/tests/nonreg_tests/bug_14553.tst b/scilab/modules/boolean/tests/nonreg_tests/bug_14553.tst
new file mode 100644
index 0000000..ff82af6
--- /dev/null
+++ b/scilab/modules/boolean/tests/nonreg_tests/bug_14553.tst
@@ -0,0 +1,21 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises - Adeline CARNIS
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- CLI SHELL MODE -->
8//
9// <-- Non-regression test for bug 14553 -->
10//
11// <-- Bugzilla URL -->
12// http://bugzilla.scilab.org/show_bug.cgi?id=14553
13//
14// <-- Short Description -->
15// find(a=b) crashed Scilab.
16a = 3;
17b = 5;
18someStr = "find(a = b)";
19assert_checkfalse(execstr(someStr, "errcatch") == 0);
20refMsg = msprintf(_("%s: Wrong number of input argument(s): %d to %d expected.\n"), "find", 1, 2);
21assert_checkerror(someStr, refMsg);