Regenerate
[deliverable/binutils-gdb.git] / gas / cgen.c
index e15e1b65346b77707a916b4af9e28a5a1e021a7a..a4ef083ca6a3122c7d3aa373910c75efb73fe4b5 100644 (file)
@@ -1,5 +1,5 @@
 /* GAS interface for targets using CGEN: Cpu tools GENerator.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
 
@@ -81,6 +81,7 @@ gas_cgen_init_parse ()
 static void
 queue_fixup (opindex, opinfo, expP)
      int           opindex;
+     int           opinfo;
      expressionS * expP;
 {
   /* We need to generate a fixup for this expression.  */
@@ -232,6 +233,7 @@ gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp)
 
 /* Used for communication between the next two procedures.  */
 static jmp_buf expr_jmp_buf;
+static int expr_jmp_buf_p;
 
 /* Callback for cgen interface.  Parse the expression at *STRP.
    The result is an error message or NULL for success (in which case
@@ -246,7 +248,7 @@ static jmp_buf expr_jmp_buf;
 
 const char *
 gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
-     CGEN_CPU_DESC cd;
+     CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
      enum cgen_parse_operand_type want;
      const char ** strP;
      int opindex;
@@ -279,12 +281,15 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
      This is done via gas_cgen_md_operand.  */
   if (setjmp (expr_jmp_buf) != 0)
     {
+      expr_jmp_buf_p = 0;
       input_line_pointer = (char *) hold;
       * resultP_1 = CGEN_PARSE_OPERAND_RESULT_ERROR;
       return "illegal operand";
     }
 
+  expr_jmp_buf_p = 1;
   expression (& exp);
+  expr_jmp_buf_p = 0;
 
   * strP = input_line_pointer;
   input_line_pointer = hold;
@@ -326,9 +331,11 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
 
 void
 gas_cgen_md_operand (expressionP)
-     expressionS * expressionP;
+     expressionS * expressionP ATTRIBUTE_UNUSED;
 {
-  longjmp (expr_jmp_buf, 1);
+  /* Don't longjmp if we're not called from within cgen_parse_operand().  */
+  if (expr_jmp_buf_p)
+    longjmp (expr_jmp_buf, 1);
 }
 
 /* Finish assembling instruction INSN.
@@ -488,7 +495,7 @@ int
 gas_cgen_md_apply_fix3 (fixP, valueP, seg)
      fixS *   fixP;
      valueT * valueP;
-     segT     seg;
+     segT     seg ATTRIBUTE_UNUSED;
 {
   char * where = fixP->fx_frag->fr_literal + fixP->fx_where;
   valueT value;
@@ -631,7 +638,7 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg)
 
 arelent *
 gas_cgen_tc_gen_reloc (section, fixP)
-     asection * section;
+     asection * section ATTRIBUTE_UNUSED;
      fixS *     fixP;
 {
   arelent * reloc;
This page took 0.023972 seconds and 4 git commands to generate.