changeset 13393:e6b97a7f1d8f mvt

8185266: [MVT] valhalla/mvt/WithFieldTest.java crashes with assert(will_link) failed: vdefault: typeflow responsibility Reviewed-by: roland
author thartmann
date Fri, 28 Jul 2017 17:56:25 +0200
parents 9f87e6962c0d
children eba06bb9ed49
files src/share/vm/ci/ciTypeFlow.cpp
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/ci/ciTypeFlow.cpp	Fri Jul 28 14:52:47 2017 +0200
+++ b/src/share/vm/ci/ciTypeFlow.cpp	Fri Jul 28 17:56:25 2017 +0200
@@ -791,16 +791,20 @@
   ciField* field = str->get_field(will_link);
   ciKlass* klass = field->holder();
   assert(klass->is_valuetype(), "should be value type");
-  // TODO: add additional checks
-  ciType* type = pop_value();
-  ciType* field_type = field->type();
-  if (field_type->is_two_word()) {
-    ciType* type2 = pop_value();
-    assert(type2->is_two_word(), "must be 2nd half");
-    assert(type == half_type(type2), "must be 2nd half");
+  if (!will_link) {
+    trap(str, klass, str->get_field_holder_index());
+  } else {
+    ciType* type = pop_value();
+    ciType* field_type = field->type();
+    assert(field_type->is_loaded(), "field type must be loaded");
+    if (field_type->is_two_word()) {
+      ciType* type2 = pop_value();
+      assert(type2->is_two_word(), "must be 2nd half");
+      assert(type == half_type(type2), "must be 2nd half");
+    }
+    pop_object();
+    push_object(klass);
   }
-  pop_object();
-  push_object(klass);
 }
 
 // ------------------------------------------------------------------