comparison src/share/vm/classfile/stackMapTable.cpp @ 1769: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 c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1768:6ee479178066 1769:1ab9e2cbfa0e
1 /* 1 /*
2 * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
150 150
151 #endif 151 #endif
152 152
153 int32_t StackMapReader::chop( 153 int32_t StackMapReader::chop(
154 VerificationType* locals, int32_t length, int32_t chops) { 154 VerificationType* locals, int32_t length, int32_t chops) {
155 if (locals == NULL) return -1;
155 int32_t pos = length - 1; 156 int32_t pos = length - 1;
156 for (int32_t i=0; i<chops; i++) { 157 for (int32_t i=0; i<chops; i++) {
157 if (locals[pos].is_category2_2nd()) { 158 if (locals[pos].is_category2_2nd()) {
158 pos -= 2; 159 pos -= 2;
159 } else { 160 } else {