see added tests at the end of Function.as. I have a feeling that function is not special, but a group of opcodes that shares the same VM stack as its caller. As observed from the tests, the caller's runtime stack could be completely violated when calling a function.
Next step would be checking if the vm stack should be protected at frame boundary. --zou On Dec 12, 2007 10:11 AM, Zou Lunkai <[EMAIL PROTECTED]> wrote: > CVSROOT: /sources/gnash > Module name: gnash > Changes by: Zou Lunkai <zoulunkai> 07/12/12 02:11:50 > > Modified files: > testsuite/actionscript.all: Function.as > > Log message: > Test that we miss the single vm stack. cmusick might interest on > this test:) > > CVSWeb URLs: > http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.60&r2=1.61 > > Patches: > Index: Function.as > =================================================================== > RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v > retrieving revision 1.60 > retrieving revision 1.61 > diff -u -b -r1.60 -r1.61 > --- Function.as 11 Dec 2007 19:23:50 -0000 1.60 > +++ Function.as 12 Dec 2007 02:11:50 -0000 1.61 > @@ -21,7 +21,7 @@ > // compile this test case with Ming makeswf, and then > // execute it like this gnash -1 -r 0 -v out.swf > > -rcsid="$Id: Function.as,v 1.60 2007/12/11 19:23:50 strk Exp $"; > +rcsid="$Id: Function.as,v 1.61 2007/12/12 02:11:50 zoulunkai Exp $"; > > #include "check.as" > > @@ -729,4 +729,62 @@ > check_equals(typeof(f()), 'undefined'); > #endif > > +#ifdef MING_SUPPORTS_ASM > + > +testvar1 = 0; > +testvar2 = 0; > +testvar3 = 0; > +asm{ > + push 'testvar1' > + push 1 > + push 'testvar2' > + push 2 > + push 'testvar3' > + push 3 > +}; > +function stack_test1() > +{ > + asm{ > + setvariable > + setvariable > + setvariable > + }; > +} > + > +stack_test1(); > + > +xcheck_equals(testvar1, 1); > +xcheck_equals(testvar2, 2); > +xcheck_equals(testvar3, 3); > + > +testvar1 = 0; > +testvar2 = 0; > +testvar3 = 0; > +asm{ > + push 'testvar1' > + push 4 > + push 'testvar2' > + push 5 > + push 'testvar3' > + push 6 > +}; > +_root.createEmptyMovieClip("clip1", '9'); > +clip1.stack_test2 = function () { > + asm{ > + setvariable > + setvariable > + setvariable > + }; > +}; > + > +clip1.stack_test2(); > + > +#if OUTPUT_VERSION > 5 > + xcheck_equals(testvar1, 4); > + xcheck_equals(testvar2, 5); > + xcheck_equals(testvar3, 6); > +#endif > + > +#endif //MING_SUPPORTS_ASM > + > totals(); > > > _______________________________________________ > Gnash-commit mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/gnash-commit > _______________________________________________ Gnash-commit mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnash-commit
