hubbitus pushed to js (master). "- Add Patch9: js-1.8.5-array-recursion.patch (bz#1178141 - http://hg.mozilla.org/mozilla-central/rev/a7b220e7425a) (..more)"
notifications at fedoraproject.org
notifications at fedoraproject.org
Wed Apr 15 15:36:37 UTC 2015
>From 815190da4e03c760dea24bfce846b23b22dcfebc Mon Sep 17 00:00:00 2001
From: Hubbitus <pahan at hubbitus.info>
Date: Wed, 15 Apr 2015 18:35:58 +0300
Subject: - Add Patch9: js-1.8.5-array-recursion.patch (bz#1178141 -
http://hg.mozilla.org/mozilla-central/rev/a7b220e7425a) - Add %%check section
diff --git a/js-1.8.5-array-recursion.patch b/js-1.8.5-array-recursion.patch
new file mode 100644
index 0000000..463eb4e
--- /dev/null
+++ b/js-1.8.5-array-recursion.patch
@@ -0,0 +1,101 @@
+diff -ur js-1.8.5.orig/js/src/jsarray.cpp js-1.8.5/js/src/jsarray.cpp
+--- js-1.8.5.orig/js/src/jsarray.cpp 2011-03-31 23:08:36.000000000 +0400
++++ js-1.8.5/js/src/jsarray.cpp 2015-04-15 01:10:10.662544828 +0300
+@@ -1223,8 +1223,6 @@
+ array_toString_sub(JSContext *cx, JSObject *obj, JSBool locale,
+ JSString *sepstr, Value *rval)
+ {
+- JS_CHECK_RECURSION(cx, return false);
+-
+ /* Get characters to use for the separator. */
+ static const jschar comma = ',';
+ const jschar *sep;
+@@ -1323,6 +1321,8 @@
+ static JSBool
+ array_toString(JSContext *cx, uintN argc, Value *vp)
+ {
++ JS_CHECK_RECURSION(cx, return false);
++
+ JSObject *obj = ToObject(cx, &vp[1]);
+ if (!obj)
+ return false;
+@@ -1357,6 +1357,8 @@
+ static JSBool
+ array_toLocaleString(JSContext *cx, uintN argc, Value *vp)
+ {
++ JS_CHECK_RECURSION(cx, return false);
++
+ JSObject *obj = ToObject(cx, &vp[1]);
+ if (!obj)
+ return false;
+@@ -1454,6 +1456,8 @@
+ static JSBool
+ array_join(JSContext *cx, uintN argc, Value *vp)
+ {
++ JS_CHECK_RECURSION(cx, return false);
++
+ JSString *str;
+ if (argc == 0 || vp[2].isUndefined()) {
+ str = NULL;
+diff --git a/js/src/tests/ecma_5/extensions/array-toString-recursion.js b/js/src/tests/ecma_5/extensions/array-toString-recursion.js
+new file mode 100644
+--- /dev/null
++++ b/js/src/tests/ecma_5/extensions/array-toString-recursion.js
+@@ -0,0 +1,46 @@
++/*
++ * Any copyright is dedicated to the Public Domain.
++ * http://creativecommons.org/licenses/publicdomain/
++ */
++
++//-----------------------------------------------------------------------------
++var BUGNUMBER = 635389;
++var summary = 'Infinite recursion via [].{toString,toLocaleString,join}';
++
++print(BUGNUMBER + ": " + summary);
++
++/**************
++ * BEGIN TEST *
++ **************/
++
++try
++{
++ var x = [];
++ x.join = Array.prototype.toString;
++ "" + x;
++ throw new Error("should have thrown");
++}
++catch (e)
++{
++ assertEq(e instanceof InternalError, true,
++ "should have thrown for over-recursion");
++}
++
++try
++{
++ var x = { toString: Array.prototype.toString, join: Array.prototype.toString };
++ "" + x;
++ throw new Error("should have thrown");
++}
++catch (e)
++{
++ assertEq(e instanceof InternalError, true,
++ "should have thrown for over-recursion");
++}
++
++/******************************************************************************/
++
++if (typeof reportCompare === "function")
++ reportCompare(true, true);
++
++print("All tests passed!");
+diff -ur js-1.8.5.orig/js/src/tests/ecma_5/extensions/jstests.list js-1.8.5/js/src/tests/ecma_5/extensions/jstests.list
+--- js-1.8.5.orig/js/src/tests/ecma_5/extensions/jstests.list 2011-03-31 23:08:36.000000000 +0400
++++ js-1.8.5/js/src/tests/ecma_5/extensions/jstests.list 2015-04-15 01:15:08.784740028 +0300
+@@ -9,6 +9,7 @@
+ script bug472534.js
+ script bug496985.js
+ script bug566661.js
++script array-toString-recursion.js
+ script eval-native-callback-is-indirect.js
+ script extension-methods-reject-null-undefined-this.js
+ skip-if(!xulRuntime.shell) script function-definition-with.js # needs evaluate()
diff --git a/js.spec b/js.spec
index 7422fab..6a14292 100644
--- a/js.spec
+++ b/js.spec
@@ -4,7 +4,7 @@ Summary: JavaScript interpreter and libraries
Name: js
Epoch: 1
Version: 1.8.5
-Release: 19%{?hgdate:.hg%{hgdate}}%{?dist}
+Release: 20%{?hgdate:.hg%{hgdate}}%{?dist}
License: GPLv2+ or LGPLv2+ or MPLv1.1
Group: Development/Languages
URL: http://www.mozilla.org/js/
@@ -19,6 +19,8 @@ Patch6: 0001-Make-js-config.h-multiarch-compatible.patch
Patch7: aarch64.patch
# bz#1096135
Patch8: ppc64le.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1178141 (http://hg.mozilla.org/mozilla-central/rev/a7b220e7425a)
+Patch9: js-1.8.5-array-recursion.patch
Provides: libjs = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Buildrequires: nspr-devel >= 4.7
@@ -61,6 +63,7 @@ you will need to install %{name}-devel.
%patch6 -p1 -b .multiarch
%patch7 -p1 -b .aarch64
%patch8 -p1 -b .ppc64le
+%patch9 -p1 -b .array-recursion
cd js
@@ -128,6 +131,10 @@ rm -rf %{buildroot}
%postun -p /sbin/ldconfig
+%check
+# it fails in strange way initially
+rm js/src/jit-test/tests/sunspider/check-date-format-tofte.js
+make -C js/src check
%files
%defattr(-,root,root,-)
@@ -143,6 +150,10 @@ rm -rf %{buildroot}
%{_includedir}/js
%changelog
+* Wed Apr 15 2015 Pavel Alexeev <Pahan at Hubbitus.info> - 1:1.8.5-20
+- Add Patch9: js-1.8.5-array-recursion.patch (bz#1178141 - http://hg.mozilla.org/mozilla-central/rev/a7b220e7425a)
+- Add %%check section
+
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:1.8.5-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/js.git/commit/?h=master&id=815190da4e03c760dea24bfce846b23b22dcfebc
More information about the scm-commits
mailing list