Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_nashorn
提交
4da90360
D
dragonwell8_nashorn
项目概览
openanolis
/
dragonwell8_nashorn
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_nashorn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4da90360
编写于
12月 04, 2019
作者:
A
andrew
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
ce12c22a
cbc3a7b7
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
80 addition
and
2 deletion
+80
-2
src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
...nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
+0
-2
src/jdk/nashorn/internal/runtime/regexp/joni/Config.java
src/jdk/nashorn/internal/runtime/regexp/joni/Config.java
+1
-0
src/jdk/nashorn/internal/runtime/regexp/joni/ScanEnvironment.java
...nashorn/internal/runtime/regexp/joni/ScanEnvironment.java
+3
-0
src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java
...internal/runtime/regexp/joni/exception/ErrorMessages.java
+1
-0
test/script/basic/JDK-8204288.js
test/script/basic/JDK-8204288.js
+35
-0
test/script/basic/JDK-8204290.js
test/script/basic/JDK-8204290.js
+40
-0
未找到文件。
src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
浏览文件 @
4da90360
...
...
@@ -541,7 +541,6 @@ class ByteCodeMachine extends StackMachine {
sprev
=
s
;
s
++;
}
sprev
=
sbegin
;
// break;
}
private
void
opAnyCharMLStar
()
{
...
...
@@ -550,7 +549,6 @@ class ByteCodeMachine extends StackMachine {
sprev
=
s
;
s
++;
}
sprev
=
sbegin
;
// break;
}
private
void
opAnyCharStarPeekNext
()
{
...
...
src/jdk/nashorn/internal/runtime/regexp/joni/Config.java
浏览文件 @
4da90360
...
...
@@ -45,6 +45,7 @@ public interface Config {
final
int
NREGION
=
10
;
final
int
MAX_BACKREF_NUM
=
1000
;
final
int
MAX_CAPTURE_GROUP_NUM
=
0x8000
;
final
int
MAX_REPEAT_NUM
=
100000
;
final
int
MAX_MULTI_BYTE_RANGES_NUM
=
10000
;
...
...
src/jdk/nashorn/internal/runtime/regexp/joni/ScanEnvironment.java
浏览文件 @
4da90360
...
...
@@ -62,6 +62,9 @@ public final class ScanEnvironment {
}
public
int
addMemEntry
()
{
if
(
numMem
>=
Config
.
MAX_CAPTURE_GROUP_NUM
)
{
throw
new
InternalException
(
ErrorMessages
.
ERR_TOO_MANY_CAPTURE_GROUPS
);
}
if
(
numMem
++
==
0
)
{
memNodes
=
new
Node
[
SCANENV_MEMNODES_SIZE
];
}
else
if
(
numMem
>=
memNodes
.
length
)
{
...
...
src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java
浏览文件 @
4da90360
...
...
@@ -31,6 +31,7 @@ public interface ErrorMessages {
final
String
ERR_PARSER_BUG
=
"internal parser error (bug)"
;
final
String
ERR_UNDEFINED_BYTECODE
=
"undefined bytecode (bug)"
;
final
String
ERR_UNEXPECTED_BYTECODE
=
"unexpected bytecode (bug)"
;
final
String
ERR_TOO_MANY_CAPTURE_GROUPS
=
"too many capture groups"
;
/* syntax error */
final
String
ERR_END_PATTERN_AT_LEFT_BRACE
=
"end pattern at left brace"
;
...
...
test/script/basic/JDK-8204288.js
0 → 100644
浏览文件 @
4da90360
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* JDK-8204288: Matching the end of a string followed by an empty greedy regex and a word boundary fails
*
* @test
* @run
*/
Assert
.
assertEquals
(
new
RegExp
(
"
c.*
\\
b
"
).
exec
(
"
abc
"
)[
0
],
"
c
"
);
Assert
.
assertEquals
(
new
RegExp
(
"
abc.*
\\
b
"
).
exec
(
"
abc
"
)[
0
],
"
abc
"
);
Assert
.
assertEquals
(
new
RegExp
(
"
\\
b.*abc.*
\\
b
"
).
exec
(
"
abc
"
)[
0
],
"
abc
"
);
test/script/basic/JDK-8204290.js
0 → 100644
浏览文件 @
4da90360
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* JDK-8204290: Add check to limit number of capture groups
*
* @test
* @run
*/
try
{
var
captureGroups
=
""
;
for
(
i
=
0
;
i
<
0x8001
;
i
++
)
{
captureGroups
+=
"
()
"
;
}
new
RegExp
(
captureGroups
);
fail
(
"
Expected exception
"
);
}
catch
(
e
)
{
Assert
.
assertTrue
(
e
instanceof
SyntaxError
);
Assert
.
assertEquals
(
e
.
message
,
"
too many capture groups
"
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录