Hello,

I have tried to implement a (naïve) hijacking mechanism that works *like a charm* under scilab 5.5.2:

newfun('scilab_set',funptr('set'));
clearfun('set');
function set(varargin)
    scilab_set(varargin(:))
    printf("...\n")
endfunction
// test the hijacked "set"
f=gcf()
set(f,"tag","1")
f.tag="2"

When I test this under  6.0.0 or 6.0.1, the last line always crashes Scilab. Is there an evident reason why ? When trying this on the command line (scilab -nw)

--> set(f,"tag","1")
...

--> f.tag="2"
...
/Applications/scilab-6.0.1.app/Contents/MacOS/bin/scilab: line 972: 27117 Illegal instruction: 4  "$SCILABBIN" "$@"

I can see that the problem occurs *after* the insertion code f.tag="2" has delegated the operation to the hijacked "set", hence the crash occurs in the built-in function which does the insertion. In order to understand why this crash occurs (under Linux or OSX), I would like to know which module is in charge of the insertion for handles (a kind of %h_i but built-in) ?

Thanks in advance

S.

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
dev@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/dev

Reply via email to