diff options
author | Frank Ch. Eigler <fche@redhat.com> | 2000-06-24 15:10:45 +0000 |
---|---|---|
committer | Frank Ch. Eigler <fche@redhat.com> | 2000-06-24 15:10:45 +0000 |
commit | 680d2857724c14e32d8df8cec611444be27a63fe (patch) | |
tree | 75021dc491ad1fceb52337b987f0bc940b4070b7 /gas | |
parent | 7fb283bce2efb82f9194393a868a179726fdb9c9 (diff) | |
download | gdb-680d2857724c14e32d8df8cec611444be27a63fe.zip gdb-680d2857724c14e32d8df8cec611444be27a63fe.tar.gz gdb-680d2857724c14e32d8df8cec611444be27a63fe.tar.bz2 |
* cgen assembler fixes; approved by original author <devans>
2000-06-24 Frank Ch. Eigler <fche@redhat.com>
* cgen.c (expr_jmp_buf_p): New validity flag for expr_jmp_buf.
(gas_cgen_parse_operand): Set it around expression() call.
(gas_cgen_md_operand): Test for it before longjmp().
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/cgen.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 4d3d4a2..379302c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2000-06-24 Frank Ch. Eigler <fche@redhat.com> + + * cgen.c (expr_jmp_buf_p): New validity flag for expr_jmp_buf. + (gas_cgen_parse_operand): Set it around expression() call. + (gas_cgen_md_operand): Test for it before longjmp(). + 2000-06-24 Kazu Hirata <kazu@hxi.com> * config/tc-h8500.c: Remove all uses of DEFUN. @@ -232,6 +232,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 @@ -279,12 +280,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; @@ -328,7 +332,9 @@ void gas_cgen_md_operand (expressionP) expressionS * expressionP; { - 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. |