8012695: Assertion message displays %u and %s text instead of actual values
authorhseigel
Wed, 24 Apr 2013 09:00:04 -0400
changeset 17073 99baa410e207
parent 17034 234c6e7b856c
child 17074 d660347efb98
child 17075 b53332c50aba
8012695: Assertion message displays %u and %s text instead of actual values Summary: USe err_msg() to create a proper assertion message. Reviewed-by: twisti, coleenp, iklam
hotspot/src/share/vm/classfile/classFileParser.hpp
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Tue Apr 23 12:32:17 2013 -0400
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Wed Apr 24 09:00:04 2013 -0400
@@ -304,7 +304,19 @@
 
   inline void assert_property(bool b, const char* msg, TRAPS) {
 #ifdef ASSERT
-    if (!b) { fatal(msg); }
+    if (!b) {
+      ResourceMark rm(THREAD);
+      fatal(err_msg(msg, _class_name->as_C_string()));
+    }
+#endif
+  }
+
+  inline void assert_property(bool b, const char* msg, int index, TRAPS) {
+#ifdef ASSERT
+    if (!b) {
+      ResourceMark rm(THREAD);
+      fatal(err_msg(msg, index, _class_name->as_C_string()));
+    }
 #endif
   }
 
@@ -312,7 +324,7 @@
     if (_need_verify) {
       guarantee_property(property, msg, index, CHECK);
     } else {
-      assert_property(property, msg, CHECK);
+      assert_property(property, msg, index, CHECK);
     }
   }