CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 08/01/15 09:35:11
Modified files: . : ChangeLog server/vm : ASHandlers.cpp testsuite/actionscript.all: ops.as testsuite/swfdec: PASSING Log message: fix ActionShift* opcodes. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5396&r2=1.5397 http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.179&r2=1.180 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/ops.as?cvsroot=gnash&r1=1.32&r2=1.33 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.84&r2=1.85 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5396 retrieving revision 1.5397 diff -u -b -r1.5396 -r1.5397 --- ChangeLog 14 Jan 2008 21:15:52 -0000 1.5396 +++ ChangeLog 15 Jan 2008 09:35:10 -0000 1.5397 @@ -1,3 +1,10 @@ +2008-01-15 Sandro Santilli <[EMAIL PROTECTED]> + + * testsuite/swfdec/PASSING: shift-{5,6,7}.swf succeed + * server/vm/ASHandlers.cpp: fix ActionShift* opcodes. + * testsuite/actionscript.all/ops.as: add tests for ActionShiftRight2 + and formerly failing tests for ActionShiftLeft. + 2008-01-14 Sandro Santilli <[EMAIL PROTECTED]> * testsuite/gnashrc.in: avoid printing malformed swf and actionscript Index: server/vm/ASHandlers.cpp =================================================================== RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v retrieving revision 1.179 retrieving revision 1.180 diff -u -b -r1.179 -r1.180 --- server/vm/ASHandlers.cpp 11 Jan 2008 16:06:54 -0000 1.179 +++ server/vm/ASHandlers.cpp 15 Jan 2008 09:35:11 -0000 1.180 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: ASHandlers.cpp,v 1.179 2008/01/11 16:06:54 strk Exp $ */ +/* $Id: ASHandlers.cpp,v 1.180 2008/01/15 09:35:11 strk Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -3555,17 +3555,16 @@ void SWFHandlers::ActionShiftLeft(ActionExec& thread) { -// GNASH_REPORT_FUNCTION; - - // env.top(1).asr(env.top(0)); as_environment& env = thread.env; thread.ensureStack(2); - boost::int16_t operand1 = env.top(1).to_int(); - boost::int16_t operand2 = env.top(0).to_int(); + boost::uint32_t amount = env.top(0).to_int(); + boost::int32_t value = env.top(1).to_int(); + + value = value << amount; - env.top(1) = operand1 << operand2; + env.top(1) = value; env.drop(1); } @@ -3576,30 +3575,30 @@ as_environment& env = thread.env; thread.ensureStack(2); - boost::int32_t operand1 = env.top(1).to_int(); - boost::int32_t operand2 = env.top(0).to_int(); + boost::uint32_t amount = env.top(0).to_int(); + boost::int32_t value = env.top(1).to_int(); - boost::int32_t res = operand1 >> operand2; + value = value >> amount; - //log_debug("%d >> %d == %d", operand1, operand2, res); + //log_debug("%d >> %d == %d", value, amount, res); - env.top(1) = res; + env.top(1) = value; env.drop(1); } void SWFHandlers::ActionShiftRight2(ActionExec& thread) { -// GNASH_REPORT_FUNCTION; - // env.top(1).lsr(env.top(0)); as_environment& env = thread.env; thread.ensureStack(2); - boost::uint32_t operand1 = env.top(1).to_int(); - boost::int32_t operand2 = env.top(0).to_int(); // TODO: check this ! + boost::uint32_t amount = env.top(0).to_int(); + boost::int32_t value = env.top(1).to_int(); + + value = boost::uint32_t(value) >> amount; - env.top(1) = boost::uint32_t( operand1 >> operand2 ); + env.top(1) = value; env.drop(1); } Index: testsuite/actionscript.all/ops.as =================================================================== RCS file: /sources/gnash/gnash/testsuite/actionscript.all/ops.as,v retrieving revision 1.32 retrieving revision 1.33 diff -u -b -r1.32 -r1.33 --- testsuite/actionscript.all/ops.as 11 Jan 2008 17:25:00 -0000 1.32 +++ testsuite/actionscript.all/ops.as 15 Jan 2008 09:35:11 -0000 1.33 @@ -20,7 +20,7 @@ * Test binary predicates (equal, less_then, greater_then, logical and bitwise ops) */ -rcsid="$Id: ops.as,v 1.32 2008/01/11 17:25:00 strk Exp $"; +rcsid="$Id: ops.as,v 1.33 2008/01/15 09:35:11 strk Exp $"; #include "check.as" @@ -590,6 +590,12 @@ y = x << 1; check_equals(y, 6); +y = 2147483647 << Infinity; +check_equals(y, 2147483647); + +y = 2147483647 << 0; +check_equals(y, 2147483647); + //------------------------------------------------ // Shift right operator (ACTION_SHIFTRIGHT : 0x64) //------------------------------------------------ @@ -664,7 +670,41 @@ // Shift right2 operator (ACTION_SHIFTRIGHT2 : 0x65) //------------------------------------------------- -// TODO ... +y = 1 >>> 3; +check_equals(y, 0); + +y = 32 >>> 4; +check_equals(y, 2); + +y = -1 >>> Infinity; +check_equals(y, -1); + +y = -1 >>> -Infinity; +check_equals(y, -1); + +y = -1 >>> 0; +check_equals(y, -1); + +y = -1 >>> NaN; +check_equals(y, -1); + +y = -1 >>> 32; +check_equals(y, -1); + +y = -1 >>> -32; +check_equals(y, -1); + +y = -1 >>> 2147483648; +check_equals(y, -1); + +y = -1 >>> 4294967296; +check_equals(y, -1); + +y = -2 >>> Infinity; +check_equals(y, -2); + +y = -2 >>> 32; +check_equals(y, -2); //------------------------------------------------- // Strict equality operator (ACTION_STRICTEQ : 0x66) @@ -730,7 +770,7 @@ check(isNaN(y)); #if OUTPUT_VERSION < 7 - totals(214); + totals(228); #else - totals(216); + totals(230); #endif Index: testsuite/swfdec/PASSING =================================================================== RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v retrieving revision 1.84 retrieving revision 1.85 diff -u -b -r1.84 -r1.85 --- testsuite/swfdec/PASSING 14 Jan 2008 20:05:14 -0000 1.84 +++ testsuite/swfdec/PASSING 15 Jan 2008 09:35:11 -0000 1.85 @@ -560,6 +560,9 @@ setvariable-function-target-6.swf:198fc6a556da1f176c0345925426da41 setvariable-function-target-7.swf:6b53e58759f28cc5be6fdd7afd465164 setvariable.swf:570db23c339623a5f17d3f6ae5f5b678 +shift-5.swf:2abb590ff9d66b6b38056bd051b33a37 +shift-6.swf:a1f04fa0397da15c63e045c660133601 +shift-7.swf:b40c81bf068a75553414fcd597497363 stack-overflow-5.swf:8a5c121b108caf5a866f6ed23149f7aa stack-overflow-6.swf:b2ce1f0c07f3237911ae393b031f1ed7 stack-overflow-7.swf:0a9241b806dd05aaee6d388c0d966a61 _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit