changeset 1689:1ab9e2cbfa0e

6870851: Bad frame_chop in StackMapTable crashes JVM Summary: Must check locals for null when processing chop frame Reviewed-by: dholmes, dcubed
author kamg
date Fri, 03 Sep 2010 14:47:05 -0400
parents 6ee479178066
children 40d7b43b6fe0
files src/share/vm/classfile/stackMapTable.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/stackMapTable.cpp	Tue Aug 31 03:14:00 2010 -0700
+++ b/src/share/vm/classfile/stackMapTable.cpp	Fri Sep 03 14:47:05 2010 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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
@@ -152,6 +152,7 @@
 
 int32_t StackMapReader::chop(
     VerificationType* locals, int32_t length, int32_t chops) {
+  if (locals == NULL) return -1;
   int32_t pos = length - 1;
   for (int32_t i=0; i<chops; i++) {
     if (locals[pos].is_category2_2nd()) {