From cea3a142ac2b91871172f949bec95e4cc3025c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20K=C3=A1d=C3=A1r?= Date: Fri, 8 Jul 2016 14:30:50 +0200 Subject: [PATCH] Regression tests are added for the recently closed fuzzer bugs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related issues: #380, #1065, #1073, #1074, #1075, #1080, #1081, #1082, #1083 JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu --- tests/jerry/regression-test-issue-1065.js | 17 ++++++++++ tests/jerry/regression-test-issue-1073.js | 18 +++++++++++ tests/jerry/regression-test-issue-1074.js | 22 +++++++++++++ tests/jerry/regression-test-issue-1075.js | 18 +++++++++++ tests/jerry/regression-test-issue-1080.js | 19 +++++++++++ tests/jerry/regression-test-issue-1081.js | 30 +++++++++++++++++ tests/jerry/regression-test-issue-1082.js | 39 +++++++++++++++++++++++ tests/jerry/regression-test-issue-1083.js | 32 +++++++++++++++++++ tests/jerry/regression-test-issue-380.js | 18 +++++++++++ 9 files changed, 213 insertions(+) create mode 100644 tests/jerry/regression-test-issue-1065.js create mode 100644 tests/jerry/regression-test-issue-1073.js create mode 100644 tests/jerry/regression-test-issue-1074.js create mode 100644 tests/jerry/regression-test-issue-1075.js create mode 100644 tests/jerry/regression-test-issue-1080.js create mode 100644 tests/jerry/regression-test-issue-1081.js create mode 100644 tests/jerry/regression-test-issue-1082.js create mode 100644 tests/jerry/regression-test-issue-1083.js create mode 100644 tests/jerry/regression-test-issue-380.js diff --git a/tests/jerry/regression-test-issue-1065.js b/tests/jerry/regression-test-issue-1065.js new file mode 100644 index 000000000..ab2df8e6c --- /dev/null +++ b/tests/jerry/regression-test-issue-1065.js @@ -0,0 +1,17 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +new (new (new RegExp().constructor)().constructor)().constructor.prototype.toString() +RegExp().constructor().constructor.prototype.compile(RegExp.prototype) diff --git a/tests/jerry/regression-test-issue-1073.js b/tests/jerry/regression-test-issue-1073.js new file mode 100644 index 000000000..314b95ee6 --- /dev/null +++ b/tests/jerry/regression-test-issue-1073.js @@ -0,0 +1,18 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +try { String.prototype(new (RegExp)()) } catch($){} +try { RegExp.prototype.compile() } catch($){} +try { isNaN(RegExp.prototype.compile(RegExp.prototype)) } catch($){} diff --git a/tests/jerry/regression-test-issue-1074.js b/tests/jerry/regression-test-issue-1074.js new file mode 100644 index 000000000..23b97be19 --- /dev/null +++ b/tests/jerry/regression-test-issue-1074.js @@ -0,0 +1,22 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +try { this.Date.prototype.$ (this.isNaN.length, this.String.fromCharCode.length) } catch($){} +try { this.String.prototype.constructor.prototype.$(new (this.RegExp)()) } catch($){} +try { this.RegExp.prototype.constructor.prototype.compile () } catch($){} +try { this.isNaN (undefined) } catch($){} +try { new (this.Date)("2015-09-17").constructor.parse() } catch($){} +try { this.isNaN(this.RegExp.prototype.compile(this.RegExp.prototype)) } catch($){} +try { new $.$ () } catch($){} diff --git a/tests/jerry/regression-test-issue-1075.js b/tests/jerry/regression-test-issue-1075.js new file mode 100644 index 000000000..a8ee4f7f8 --- /dev/null +++ b/tests/jerry/regression-test-issue-1075.js @@ -0,0 +1,18 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +try { new (RegExp)().$() } catch($){} +try { RegExp.prototype.compile() } catch($){} +try { new (this.$)(1, RegExp.prototype.compile(RegExp.prototype)) } catch($){} diff --git a/tests/jerry/regression-test-issue-1080.js b/tests/jerry/regression-test-issue-1080.js new file mode 100644 index 000000000..70f658a49 --- /dev/null +++ b/tests/jerry/regression-test-issue-1080.js @@ -0,0 +1,19 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +((new RegExp("}").constructor)("a", "g").constructor)(undefined).constructor.prototype.toString(); +new Date("2015-07-09T12:13:14.121+01:30").toISOString(); +RegExp(new RegExp("a", "g")).constructor("").constructor.prototype.compile(RegExp.prototype); +new Date("2015-09-17").getUTCFullYear(); diff --git a/tests/jerry/regression-test-issue-1081.js b/tests/jerry/regression-test-issue-1081.js new file mode 100644 index 000000000..6b375744d --- /dev/null +++ b/tests/jerry/regression-test-issue-1081.js @@ -0,0 +1,30 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +try { new RegExp().compile(A) } catch (err) {} +try { A } catch (err) {} +try { new RegExp().constructor.prototype.toString() } catch (A) {} +try { A } catch (err) {} +try { new RegExp(1, "g").exec(1) } catch (A) {} +try { A } catch (err) {} +try { A } catch (A) {} +try { A } catch (A) {} +try { new (Boolean.constructor.prototype) } catch (err) {} +try { Boolean } catch (A) {} +try { A } catch(A) {} +try { new RegExp().compile(new (RegExp)()) } catch (A) {} +try { Math.max().constructor.seal(A) } catch (err) {} +try { Date.parse(RegExp.prototype.compile(RegExp.prototype)) } catch(A) {} +try { Boolean.A() } catch (err) {} diff --git a/tests/jerry/regression-test-issue-1082.js b/tests/jerry/regression-test-issue-1082.js new file mode 100644 index 000000000..f427f3be1 --- /dev/null +++ b/tests/jerry/regression-test-issue-1082.js @@ -0,0 +1,39 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +try { new (String)().A.A.A (A) } catch (A) {} +try { new (this.RegExp)().A () } catch (A) {} +try { A.A.A () } catch (A) {} +try { ; } catch (A) {} +try { new A.A () } catch (A) {} +try { new (this.Date)().setMinutes (this.RegExp.prototype) } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { new A.A (A) } catch (A) {} +try { this.A (A) } catch (A) {} +try { new A.A () } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { new A().A () } catch (A) {} +try { new A().A () } catch (A) {} +try { this.isNaN (this.RegExp.prototype.compile (this.RegExp.prototype)) } catch (A) {} +try { ; } catch (A) {} +try { A.A.A (A) } catch (A) {} diff --git a/tests/jerry/regression-test-issue-1083.js b/tests/jerry/regression-test-issue-1083.js new file mode 100644 index 000000000..2fea34a0c --- /dev/null +++ b/tests/jerry/regression-test-issue-1083.js @@ -0,0 +1,32 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +try { ; } catch (A) {} +try { new (this.String)().A.A.A (A) } catch (A) {} +try { ; } catch (A) {} +try { new (this.RegExp)().A () } catch (A) {} +try { A.A.A () } catch (A) {} +try { } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { ; } catch (A) {} +try { new A.A () } catch (A) {} +try { new (this.Date)().setMinutes (this.RegExp.prototype) } catch (A) {} +try { this.A (A) } catch (A) {} +try { new A.A () } catch (A) {} +try { this.isNaN (this.RegExp.prototype.compile (this.RegExp.prototype)) } catch (A) {} +try { ; } catch (A) {} +try { A.A.A(A) } catch (A) {} diff --git a/tests/jerry/regression-test-issue-380.js b/tests/jerry/regression-test-issue-380.js new file mode 100644 index 000000000..20d68dd43 --- /dev/null +++ b/tests/jerry/regression-test-issue-380.js @@ -0,0 +1,18 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +var v_0 = []; +var v_1 = [['\u200E', '\u0601', '\u0602', '\u0603', '\u06DD', '\u070F'],[0x1107, 0x1175, 0x11B0]]; +v_0[v_1];