[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp testsu...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp testsu... |
Date: |
Thu, 02 Aug 2007 17:21:38 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/08/02 17:21:37
Modified files:
. : ChangeLog
server/vm : ASHandlers.cpp
testsuite/actionscript.all: ops.as
Log message:
* server/vm/ASHandlers.cpp: shift right/left : take undefined
values as zeroes.
* testsuite/actionscript.all/ops.as: minor additions, xcheck to
check.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3914&r2=1.3915
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.114&r2=1.115
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/ops.as?cvsroot=gnash&r1=1.4&r2=1.5
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3914
retrieving revision 1.3915
diff -u -b -r1.3914 -r1.3915
--- ChangeLog 2 Aug 2007 16:07:28 -0000 1.3914
+++ ChangeLog 2 Aug 2007 17:21:37 -0000 1.3915
@@ -1,5 +1,12 @@
2007-08-02 Sandro Santilli <address@hidden>
+ * server/vm/ASHandlers.cpp: shift right/left : take undefined
+ values as zeroes.
+ * testsuite/actionscript.all/ops.as: minor additions, xcheck to
+ check.
+
+2007-08-02 Sandro Santilli <address@hidden>
+
* server/PropertyList.cpp: add compile-time macro for debugging
property allocations.
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -b -r1.114 -r1.115
--- server/vm/ASHandlers.cpp 31 Jul 2007 15:30:29 -0000 1.114
+++ server/vm/ASHandlers.cpp 2 Aug 2007 17:21:37 -0000 1.115
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: ASHandlers.cpp,v 1.114 2007/07/31 15:30:29 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.115 2007/08/02 17:21:37 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -3075,6 +3075,7 @@
double operand1 = env.top(1).to_number(&env);
double operand2 = env.top(0).to_number(&env);
+ // TODO: have as_value::to_number<int> handle this ?
if ( isnan(operand1) ) operand1 = 0;
if ( isnan(operand2) ) operand2 = 0;
@@ -3092,6 +3093,7 @@
double operand1 = env.top(1).to_number(&env);
double operand2 = env.top(0).to_number(&env);
+ // TODO: have as_value::to_number<int> handle this ?
if ( isnan(operand1) ) operand1 = 0;
if ( isnan(operand2) ) operand2 = 0;
@@ -3110,6 +3112,7 @@
double operand1 = env.top(1).to_number(&env);
double operand2 = env.top(0).to_number(&env);
+ // TODO: have as_value::to_number<int> handle this ?
if ( isnan(operand1) ) operand1 = 0;
if ( isnan(operand2) ) operand2 = 0;
@@ -3130,7 +3133,10 @@
double operand1 = env.top(1).to_number(&env);
double operand2 = env.top(0).to_number(&env);
- env.top(1) = int(operand1) >> int(operand2);
+ // TODO: have as_value::to_number<int> handle this ?
+ if ( isnan(operand1) ) operand1=0;
+
+ env.top(1) = int16_t(operand1) << int(operand2);
env.drop(1);
}
@@ -3147,7 +3153,10 @@
double operand1 = env.top(1).to_number(&env);
double operand2 = env.top(0).to_number(&env);
- env.top(1) = int(operand1) >> int(operand2);
+ // TODO: have as_value::to_number<int> handle this ?
+ if ( isnan(operand1) ) operand1=0;
+
+ env.top(1) = int16_t(operand1) >> int(operand2);
env.drop(1);
}
@@ -3163,6 +3172,9 @@
double operand1 = env.top(1).to_number(&env);
double operand2 = env.top(0).to_number(&env);
+ // TODO: have as_value::to_number<int> handle this ?
+ if ( isnan(operand1) ) operand1=0;
+
env.top(1) = uint32_t(operand1) >> int(operand2);
env.drop(1);
}
Index: testsuite/actionscript.all/ops.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/ops.as,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- testsuite/actionscript.all/ops.as 2 Aug 2007 09:33:40 -0000 1.4
+++ testsuite/actionscript.all/ops.as 2 Aug 2007 17:21:37 -0000 1.5
@@ -20,7 +20,7 @@
* Test binary predicates (equal, less_then, greater_then, logical and
bitwise ops)
*/
-rcsid="$Id: ops.as,v 1.4 2007/08/02 09:33:40 zoulunkai Exp $";
+rcsid="$Id: ops.as,v 1.5 2007/08/02 17:21:37 strk Exp $";
#include "check.as"
@@ -370,7 +370,7 @@
x = 1;
y = x << 2;
-xcheck_equals(y, 4);
+check_equals(y, 4);
x = 0xffffffff;
y = x << 16;
@@ -378,23 +378,27 @@
x = 1.9;
y = x << 2;
-xcheck_equals(y, 4);
+check_equals(y, 4);
x= undefined;
y = x << 1;
+check_equals(typeof(y), 'number');
+check(! isnan(y) );
check_equals(y, 0);
+check_equals(0 << 1, 0);
+
x= NaN;
y = x << 1;
-xcheck_equals(y, 0);
+check_equals(y, 0);
x = "abcd";
y = x << 1;
-xcheck_equals(y, 0);
+check_equals(y, 0);
x = "3";
y = x << 1;
-xcheck_equals(y, 6);
+check_equals(y, 6);
x = String("3");
y = x << 1;
@@ -426,11 +430,11 @@
x= NaN;
y = x >> 1;
-xcheck_equals(y, 0);
+check_equals(y, 0);
x = "abcd";
y = x >> 1;
-xcheck_equals(y, 0);
+check_equals(y, 0);
x = "7";
y = x >> 1;
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp testsu...,
Sandro Santilli <=