changeset 2630:fe240d87c6ec

7061101: adlc should complain about mixing block and expression forms of ins_encode Reviewed-by: kvn
author never
date Wed, 06 Jul 2011 09:27:54 -0700
parents 15559220ce79
children 3e23978ea0c3
files src/share/vm/adlc/adlparse.cpp
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/adlc/adlparse.cpp	Tue Jul 05 16:07:54 2011 -0700
+++ b/src/share/vm/adlc/adlparse.cpp	Wed Jul 06 09:27:54 2011 -0700
@@ -2812,6 +2812,13 @@
     params->add_entry(param);
   }
 
+  // Check for duplicate ins_encode sections after parsing the block
+  // so that parsing can continue and find any other errors.
+  if (inst._insencode != NULL) {
+    parse_err(SYNERR, "Multiple ins_encode sections defined\n");
+    return;
+  }
+
   // Set encode class of this instruction.
   inst._insencode = encrule;
 }
@@ -3044,6 +3051,13 @@
   next_char();                     // move past ';'
   skipws();                        // be friendly to oper_parse()
 
+  // Check for duplicate ins_encode sections after parsing the block
+  // so that parsing can continue and find any other errors.
+  if (inst._insencode != NULL) {
+    parse_err(SYNERR, "Multiple ins_encode sections defined\n");
+    return;
+  }
+
   // Debug Stuff
   if (_AD._adl_debug > 1) fprintf(stderr,"Instruction Encode: %s\n", ec_name);