summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorCedric Delamarre <cedric.delamarre@scilab-enterprises.com>2016-11-03 15:50:41 +0100
committerCedric Delamarre <cedric.delamarre@scilab-enterprises.com>2016-11-03 15:51:04 +0100
commit82e22069e9e6bc12e23c5ad0a2aed4c2ae6f53a5 (patch)
treec519ce497c8c681e7d0dd14eeb215066d0ab54ba /scilab
parent426dbacd7adbc04346db09a8fd17479c6f240198 (diff)
downloadscilab-82e22069e9e6bc12e23c5ad0a2aed4c2ae6f53a5.zip
scilab-82e22069e9e6bc12e23c5ad0a2aed4c2ae6f53a5.tar.gz
[bug_14379] bad expected size in recursive extraction.
test_run ast bug_14379 Change-Id: I1b0cc3fef28290728e0ffd081dd9fc7675858abb
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md1
-rw-r--r--scilab/modules/ast/src/cpp/ast/run_CallExp.hpp5
-rw-r--r--scilab/modules/ast/tests/nonreg_tests/bug_14379.dia.ref25
-rw-r--r--scilab/modules/ast/tests/nonreg_tests/bug_14379.tst30
4 files changed, 61 insertions, 0 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index a50b17a..fdf8b43 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -343,6 +343,7 @@ Bug Fixes
343* [#13990](http://bugzilla.scilab.org/show_bug.cgi?id=13990): `warning` with localization enabled some memory corruption 343* [#13990](http://bugzilla.scilab.org/show_bug.cgi?id=13990): `warning` with localization enabled some memory corruption
344* [#14192](http://bugzilla.scilab.org/show_bug.cgi?id=14192): `g_margin` error-ed for double integrator. 344* [#14192](http://bugzilla.scilab.org/show_bug.cgi?id=14192): `g_margin` error-ed for double integrator.
345* [#14367](http://bugzilla.scilab.org/show_bug.cgi?id=14367): `edit_curv` failed opening due to a `[]+1` operation. 345* [#14367](http://bugzilla.scilab.org/show_bug.cgi?id=14367): `edit_curv` failed opening due to a `[]+1` operation.
346* [#14379](http://bugzilla.scilab.org/show_bug.cgi?id=14379): Problem with lists of functions having 2 arguments.
346* [#14395](http://bugzilla.scilab.org/show_bug.cgi?id=14395): `dir` displayed a []+".." warning when no subdirectory exists. 347* [#14395](http://bugzilla.scilab.org/show_bug.cgi?id=14395): `dir` displayed a []+".." warning when no subdirectory exists.
347* [#14448](http://bugzilla.scilab.org/show_bug.cgi?id=14448): removed havewindow() was still documented 348* [#14448](http://bugzilla.scilab.org/show_bug.cgi?id=14448): removed havewindow() was still documented
348* [#14461](http://bugzilla.scilab.org/show_bug.cgi?id=14461): Calling `grand(n, "markov", P, x0)` did not return all outputs. 349* [#14461](http://bugzilla.scilab.org/show_bug.cgi?id=14461): Calling `grand(n, "markov", P, x0)` did not return all outputs.
diff --git a/scilab/modules/ast/src/cpp/ast/run_CallExp.hpp b/scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
index ede6020..89333db 100644
--- a/scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
+++ b/scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
@@ -121,6 +121,9 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
121 throw ie; 121 throw ie;
122 } 122 }
123 123
124 // reset expected size for recursive call
125 // ie [a, b] = l(1)(1), where l is a list containing a function with two output argument
126 setExpectedSize(-1);
124 // get function/variable 127 // get function/variable
125 try 128 try
126 { 129 {
@@ -131,6 +134,8 @@ void RunVisitorT<T>::visitprivate(const CallExp &e)
131 CoverageInstance::stopChrono((void*)&e); 134 CoverageInstance::stopChrono((void*)&e);
132 throw; 135 throw;
133 } 136 }
137 setExpectedSize(iSaveExpectedSize);
138
134 types::InternalType* pIT = getResult(); 139 types::InternalType* pIT = getResult();
135 140
136 // pIT can be NULL if one of call return nothing. foo()(1) with foo return nothing. 141 // pIT can be NULL if one of call return nothing. foo()(1) with foo return nothing.
diff --git a/scilab/modules/ast/tests/nonreg_tests/bug_14379.dia.ref b/scilab/modules/ast/tests/nonreg_tests/bug_14379.dia.ref
new file mode 100644
index 0000000..c480b45
--- /dev/null
+++ b/scilab/modules/ast/tests/nonreg_tests/bug_14379.dia.ref
@@ -0,0 +1,25 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises - Cedric Delamarre
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 14379 -->
10//
11// <-- Bugzilla URL -->
12// http://bugzilla.scilab.org/14379
13//
14// <-- Short Description -->
15// Problem with lists of functions having 2 arguments
16function [y1, y2] = F1(x)
17 y1 = x + 1;
18 y2 = x + 2;
19endfunction
20L = list(F1);
21[y1, y2] = L(1)(1);
22assert_checkequal(y1, 2);
23assert_checkequal(y2, 3);
24res = L(1)(1:10)(5);
25assert_checkequal(res, 6);
diff --git a/scilab/modules/ast/tests/nonreg_tests/bug_14379.tst b/scilab/modules/ast/tests/nonreg_tests/bug_14379.tst
new file mode 100644
index 0000000..b0fdbf4
--- /dev/null
+++ b/scilab/modules/ast/tests/nonreg_tests/bug_14379.tst
@@ -0,0 +1,30 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2016 - Scilab Enterprises - Cedric Delamarre
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 14379 -->
10//
11// <-- Bugzilla URL -->
12// http://bugzilla.scilab.org/14379
13//
14// <-- Short Description -->
15// Problem with lists of functions having 2 arguments
16
17function [y1, y2] = F1(x)
18 y1 = x + 1;
19 y2 = x + 2;
20endfunction
21
22L = list(F1);
23[y1, y2] = L(1)(1);
24
25assert_checkequal(y1, 2);
26assert_checkequal(y2, 3);
27
28
29res = L(1)(1:10)(5);
30assert_checkequal(res, 6);