summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scilab/CHANGES_5.2.X2
-rw-r--r--scilab/modules/data_structures/src/fortran/followpath.f10
-rw-r--r--scilab/modules/data_structures/tests/nonreg_tests/bug_6792.dia.ref29
-rw-r--r--scilab/modules/data_structures/tests/nonreg_tests/bug_6792.tst37
4 files changed, 76 insertions, 2 deletions
diff --git a/scilab/CHANGES_5.2.X b/scilab/CHANGES_5.2.X
index 1a5eda5..7b3c6b2 100644
--- a/scilab/CHANGES_5.2.X
+++ b/scilab/CHANGES_5.2.X
@@ -115,6 +115,8 @@ Bug Fixes:
115 115
116* bug 6712 fixed - The "title" function forced displaying axes. 116* bug 6712 fixed - The "title" function forced displaying axes.
117 117
118* bug 6792 fixed - wrong interpretation of macro arguments when the macro call appears in an list extraction
119
118 120
119 121
120 122
diff --git a/scilab/modules/data_structures/src/fortran/followpath.f b/scilab/modules/data_structures/src/fortran/followpath.f
index 2a2c688..8dea9fb 100644
--- a/scilab/modules/data_structures/src/fortran/followpath.f
+++ b/scilab/modules/data_structures/src/fortran/followpath.f
@@ -101,11 +101,17 @@ c extract infos out of the current sublist
101 llisti=sadr(illisti+mi+3) 101 llisti=sadr(illisti+mi+3)
102 voll=istk(illisti+mi+2)-1+sadr(3+mi) 102 voll=istk(illisti+mi+2)-1+sadr(3+mi)
103c go ahead along the path 103c go ahead along the path
104
105 if(typi.eq.13.or.typi.eq.11) then
106c . not an extraction but a function call
107 info=2
108 goto 50
109 endif
110
104c 111c
105 if(istk(ilindi).eq.10) then 112 if(istk(ilindi).eq.10) then
106c . current element index is a name 113c . current element index is a name
107 114 if (istk(ilindi+1)*istk(ilindi+2).ne.1) then
108 if(istk(ilindi+1)*istk(ilindi+2).ne.1) then
109 info=3 115 info=3
110 goto 50 116 goto 50
111c call error(21) 117c call error(21)
diff --git a/scilab/modules/data_structures/tests/nonreg_tests/bug_6792.dia.ref b/scilab/modules/data_structures/tests/nonreg_tests/bug_6792.dia.ref
new file mode 100644
index 0000000..763e20f
--- /dev/null
+++ b/scilab/modules/data_structures/tests/nonreg_tests/bug_6792.dia.ref
@@ -0,0 +1,29 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - INRIA -Serge.Steer@inria.fr
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- Non-regression test for bug 6792 -->
8//
9// <-- Bugzilla URL -->
10// http://bugzilla.scilab.org/show_bug.cgi?id=6792
11//
12// <-- Short Description -->
13// mis-interpretation of macro arguments when the macro call appears in an list extraction
14function [x,y]=fun(varargin), x=varargin,y=size(varargin),endfunction
15function y=%foo_e(name,ml),y=fun,endfunction
16M=mlist(['foo']);
17M1=mlist(['foo','meth'],fun);
18[x,y]=M.meth(['hello' 'world']);
19if or(x<>list(['hello' 'world']))|y<>1 then bugmes();quit;end
20[x,y]=M1.meth(['hello' 'world']);
21if or(x<>list(['hello' 'world']))|y<>1 then bugmes();quit;end
22[x,y]=M.meth('xx',list(1,2,3));
23if or(x<>list('xx',list(1,2,3)))|y<>2 then bugmes();quit;end
24[x,y]=M1.meth('xx',list(1,2,3));
25if or(x<>list('xx',list(1,2,3)))|y<>2 then bugmes();quit;end
26[x,y]=M.meth('xx',1,2,3);
27if or(x<>list('xx',1,2,3))|y<>4 then bugmes();quit;end
28[x,y]=M1.meth('xx',1,2,3);
29if or(x<>list('xx',1,2,3))|y<>4 then bugmes();quit;end
diff --git a/scilab/modules/data_structures/tests/nonreg_tests/bug_6792.tst b/scilab/modules/data_structures/tests/nonreg_tests/bug_6792.tst
new file mode 100644
index 0000000..5f01e5d
--- /dev/null
+++ b/scilab/modules/data_structures/tests/nonreg_tests/bug_6792.tst
@@ -0,0 +1,37 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - INRIA -Serge.Steer@inria.fr
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- Non-regression test for bug 6792 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=6792
12//
13// <-- Short Description -->
14// mis-interpretation of macro arguments when the macro call appears in an list extraction
15function [x,y]=fun(varargin), x=varargin,y=size(varargin),endfunction
16function y=%foo_e(name,ml),y=fun,endfunction
17
18M=mlist(['foo']);
19M1=mlist(['foo','meth'],fun);
20
21[x,y]=M.meth(['hello' 'world']);
22if or(x<>list(['hello' 'world']))|y<>1 then pause,end
23[x,y]=M1.meth(['hello' 'world']);
24if or(x<>list(['hello' 'world']))|y<>1 then pause,end
25
26[x,y]=M.meth('xx',list(1,2,3));
27if or(x<>list('xx',list(1,2,3)))|y<>2 then pause,end
28
29[x,y]=M1.meth('xx',list(1,2,3));
30if or(x<>list('xx',list(1,2,3)))|y<>2 then pause,end
31
32[x,y]=M.meth('xx',1,2,3);
33if or(x<>list('xx',1,2,3))|y<>4 then pause,end
34
35[x,y]=M1.meth('xx',1,2,3);
36if or(x<>list('xx',1,2,3))|y<>4 then pause,end
37