From f787a8d9b82b70d212d5523d8b4f8b5968d7a64b Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Fri, 6 Dec 1996 09:13:25 +0000 Subject: [PATCH] Fri Dec 6 00:55:48 1996 Martin * config/tc-d10v.c (md_assemble): Check to see if prev_seg is initialized before using it. (d10v_cleanup): No longer uses its argument, so make it void. * config/tc-d10v.h (d10v_cleanup): Change prototype. --- gas/ChangeLog | 11 ++++++++--- gas/config/tc-d10v.c | 15 +++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 232426978d..6d8e2f0b9b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,8 +1,13 @@ -Thu Dec 5 23:44:42 1996 Michael Meissner +start-sanitize-d10v +Fri Dec 6 00:55:48 1996 Martin - * config/tc-ppc.c (comment_char): Correctly define for non ELF - systems. + * config/tc-d10v.c (md_assemble): Check to see if prev_seg + is initialized before using it. + (d10v_cleanup): No longer uses its argument, so make it void. + * config/tc-d10v.h (d10v_cleanup): Change prototype. + +end-sanitize-d10v Thu Dec 5 11:03:31 1996 Ian Lance Taylor * write.c (fixup_segment): Don't discard the symbol for a PC diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c index 1bd9debea2..fc143be196 100644 --- a/gas/config/tc-d10v.c +++ b/gas/config/tc-d10v.c @@ -905,7 +905,7 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) static unsigned long prev_insn; static struct d10v_opcode *prev_opcode = 0; static subsegT prev_subseg; -static segT prev_seg; +static segT prev_seg = 0;; void md_assemble (str) @@ -942,7 +942,7 @@ md_assemble (str) /* if two instructions are present and we already have one saved then first write it out */ - d10v_cleanup(0); + d10v_cleanup(); /* assemble first instruction and save it */ prev_insn = do_assemble (str, &prev_opcode); @@ -975,15 +975,15 @@ md_assemble (str) { if (extype) as_fatal("Unable to mix instructions as specified"); - d10v_cleanup(0); + d10v_cleanup(); write_long (opcode, insn, fixups); prev_opcode = NULL; return; } - if (prev_opcode && ((prev_seg != now_seg) || (prev_subseg != now_subseg))) - d10v_cleanup(0); - + if (prev_opcode && prev_seg && ((prev_seg != now_seg) || (prev_subseg != now_subseg))) + d10v_cleanup(); + if (prev_opcode && (write_2_short (prev_opcode, prev_insn, opcode, insn, extype, fixups) == 0)) { /* no instructions saved */ @@ -1355,8 +1355,7 @@ md_apply_fix3 (fixp, valuep, seg) instructions to see if it can package them with the next instruction, there may be a short instruction that still needs written. */ int -d10v_cleanup (done) - int done; +d10v_cleanup () { segT seg; subsegT subseg;