172 }
173 return pos+1;
174 }
175
176 #define CHECK_NT CHECK_(VerificationType::bogus_type())
177
178 VerificationType StackMapReader::parse_verification_type(u1* flags, TRAPS) {
179 u1 tag = _stream->get_u1(CHECK_NT);
180 if (tag < (u1)ITEM_UninitializedThis) {
181 return VerificationType::from_tag(tag);
182 }
183 if (tag == ITEM_Object) {
184 u2 class_index = _stream->get_u2(CHECK_NT);
185 int nconstants = _cp->length();
186 if ((class_index <= 0 || class_index >= nconstants) ||
187 (!_cp->tag_at(class_index).is_klass() &&
188 !_cp->tag_at(class_index).is_unresolved_klass())) {
189 _stream->stackmap_format_error("bad class index", THREAD);
190 return VerificationType::bogus_type();
191 }
192 return VerificationType::reference_type(_cp->klass_name_at(class_index));
193 }
194 if (tag == ITEM_UninitializedThis) {
195 if (flags != nullptr) {
196 *flags |= FLAG_THIS_UNINIT;
197 }
198 return VerificationType::uninitialized_this_type();
199 }
200 if (tag == ITEM_Uninitialized) {
201 u2 offset = _stream->get_u2(CHECK_NT);
202 if (offset >= _code_length ||
203 _code_data[offset] != ClassVerifier::NEW_OFFSET) {
204 _verifier->class_format_error(
205 "StackMapTable format error: bad offset for Uninitialized");
206 return VerificationType::bogus_type();
207 }
208 return VerificationType::uninitialized_type(offset);
209 }
210 _stream->stackmap_format_error("bad verification type", THREAD);
211 return VerificationType::bogus_type();
212 }
|
172 }
173 return pos+1;
174 }
175
176 #define CHECK_NT CHECK_(VerificationType::bogus_type())
177
178 VerificationType StackMapReader::parse_verification_type(u1* flags, TRAPS) {
179 u1 tag = _stream->get_u1(CHECK_NT);
180 if (tag < (u1)ITEM_UninitializedThis) {
181 return VerificationType::from_tag(tag);
182 }
183 if (tag == ITEM_Object) {
184 u2 class_index = _stream->get_u2(CHECK_NT);
185 int nconstants = _cp->length();
186 if ((class_index <= 0 || class_index >= nconstants) ||
187 (!_cp->tag_at(class_index).is_klass() &&
188 !_cp->tag_at(class_index).is_unresolved_klass())) {
189 _stream->stackmap_format_error("bad class index", THREAD);
190 return VerificationType::bogus_type();
191 }
192 Symbol* klass_name = _cp->klass_name_at(class_index);
193 return VerificationType::reference_type(klass_name);
194 }
195 if (tag == ITEM_UninitializedThis) {
196 if (flags != nullptr) {
197 *flags |= FLAG_THIS_UNINIT;
198 }
199 return VerificationType::uninitialized_this_type();
200 }
201 if (tag == ITEM_Uninitialized) {
202 u2 offset = _stream->get_u2(CHECK_NT);
203 if (offset >= _code_length ||
204 _code_data[offset] != ClassVerifier::NEW_OFFSET) {
205 _verifier->class_format_error(
206 "StackMapTable format error: bad offset for Uninitialized");
207 return VerificationType::bogus_type();
208 }
209 return VerificationType::uninitialized_type(offset);
210 }
211 _stream->stackmap_format_error("bad verification type", THREAD);
212 return VerificationType::bogus_type();
213 }
|