From efb3da2781f577e319e91cee4bcd3aae47d4d02f Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Fri, 21 Apr 2017 06:17:23 +0200 Subject: [PATCH] * Bug #15137 fixed : ilib_build cannot build a library with more than 999 function entries in Scilab 6 Change-Id: I0cba7e99b30b25583a23a47830d0cbcb58dabed5 Signed-off-by: Simon Marchetto --- scilab/CHANGES.md | 1 + scilab/modules/dynamic_link/macros/ilib_build.sci | 4 --- .../dynamic_link/tests/nonreg_tests/bug_15137.tst | 26 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 scilab/modules/dynamic_link/tests/nonreg_tests/bug_15137.tst diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index 7dc4475..b6093a7 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -371,6 +371,7 @@ the [development mailing list](dev@lists.scilab.org) for a particular toolbox. * [#15072](http://bugzilla.scilab.org/show_bug.cgi?id=15072): The context was stored as a root diagram attribute instead of being stored on each Superblock layer. * [#15079](http://bugzilla.scilab.org/show_bug.cgi?id=15079): When all children of a graphic handle have not the same number of sub-children, any vectorized extraction or insertion in subchildren failed. * [#15117](http://bugzilla.scilab.org/show_bug.cgi?id=15117): Imbricated optim/leastsq/lsqrsolve/fsolve calls either crashed or returned errors +* [#15137](http://bugzilla.scilab.org/show_bug.cgi?id=15137): ilib_build cannot build a library with more than 999 function entries in Scilab 6 ### Bugs fixed in 6.0.0: diff --git a/scilab/modules/dynamic_link/macros/ilib_build.sci b/scilab/modules/dynamic_link/macros/ilib_build.sci index cdef2f1..dd29f06 100644 --- a/scilab/modules/dynamic_link/macros/ilib_build.sci +++ b/scilab/modules/dynamic_link/macros/ilib_build.sci @@ -45,10 +45,6 @@ function ilib_build(ilib_name, .. error(999,msprintf(_("%s: Wrong type for input argument #%d: A matrix of strings expected.\n"), "ilib_build", 2)); end - if size(table,"*") > 999 * 2 then - error(999,msprintf(_("%s: Wrong size for input argument #%d: A matrix of strings < 999 expected.\n"), "ilib_build", 2)); - end - if getos() <> "Windows" & strncpy(ilib_name, 3) <> "lib" then // We add a leading lib under Linux/Unix because it is the way ilib_name = "lib" + ilib_name; diff --git a/scilab/modules/dynamic_link/tests/nonreg_tests/bug_15137.tst b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_15137.tst new file mode 100644 index 0000000..4d6f442 --- /dev/null +++ b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_15137.tst @@ -0,0 +1,26 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2017 - Scilab Enterprises +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- NO CHECK REF --> +// <-- Non-regression test for bug 15137 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=15137 +// +// <-- Short Description --> +// ilib_build cannot build a library with more than 999 function entries in Scilab 6 + +cd(TMPDIR); + +funcs = ["foo" + string(1:1000)', "sci_foo" + string(1:1000)']; +code = "int sci_foo" + string(1:1000)' + "(char *fname, void * pvApiCtx) {};"; +filename = "foo.c"; +mputl(code, fullfile(TMPDIR, filename)); +libname = "foo"; + +ierr = execstr("ilib_build(libname, funcs, filename, []);", "errcatch"); +assert_checkequal(ierr, 0); \ No newline at end of file -- 1.7.9.5