aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsundar <none@none>2014-01-03 10:09:48 +0530
committersundar <none@none>2014-01-03 10:09:48 +0530
commit48d121ce31e9b560f71dd85db920e016a40cda0c (patch)
tree8be5883f1e7c86f384017f304764795a3c0a239f /src
parentf4d9ee99925c6eae5f2423d9ea654f72efa9b310 (diff)
downloadnashorn-48d121ce31e9b560f71dd85db920e016a40cda0c.tar.gz
8031106: Nashorn: IndexOutOfBoundsException in NashornCallSiteDescriptor.getNameToken()
Reviewed-by: hannesw, jlaskey
Diffstat (limited to 'src')
-rw-r--r--src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java b/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java
index 32f30764..8fc76c19 100644
--- a/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java
+++ b/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java
@@ -93,7 +93,8 @@ final class ReflectionCheckLinker implements TypeBasedGuardingDynamicLinker{
if ((self instanceof Class) && Modifier.isPublic(((Class<?>)self).getModifiers())) {
final CallSiteDescriptor desc = requestWithoutContext.getCallSiteDescriptor();
if(CallSiteDescriptorFactory.tokenizeOperators(desc).contains("getProp")) {
- if ("static".equals(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND))) {
+ if (desc.getNameTokenCount() > CallSiteDescriptor.NAME_OPERAND &&
+ "static".equals(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND))) {
if (Context.isAccessibleClass((Class<?>)self) && !isReflectionClass((Class<?>)self)) {
// If "getProp:static" passes access checks, allow access.