< prev index next >

src/share/vm/adlc/adlparse.cpp

Print this page
rev 8929 : 8214059: Undefined behaviour in ADLC
Reviewed-by: shade, kbarrett
Contributed-by: Simon Tooke <stooke@redhat.com>

@@ -2866,11 +2866,12 @@
   // synthesize the arguments list for the enc_class from the
   // arguments to the instruct definition.
   const char* param = NULL;
   inst._parameters.reset();
   while ((param = inst._parameters.iter()) != NULL) {
-    OperandForm* opForm = (OperandForm*) inst._localNames[param];
+    OpClassForm* opForm = inst._localNames[param]->is_opclass();
+    assert(opForm != NULL, "sanity");
     encoding->add_parameter(opForm->_ident, param);
   }
 
   if (!inst._is_postalloc_expand) {
     // Define a MacroAssembler instance for use by the encoding.  The

@@ -3336,11 +3337,12 @@
   // synthesize the arguments list for the enc_class from the
   // arguments to the instruct definition.
   const char* param = NULL;
   inst._parameters.reset();
   while ((param = inst._parameters.iter()) != NULL) {
-    OperandForm* opForm = (OperandForm*) inst._localNames[param];
+    OpClassForm* opForm = inst._localNames[param]->is_opclass();
+    assert(opForm != NULL, "sanity");
     encoding->add_parameter(opForm->_ident, param);
   }
 
   // Parse the following ( ) expression.
   constant_parse_expression(encoding, ec_name);
< prev index next >