Skip to content

Commit

Permalink
struct insn: remove unused forw_ref flag
Browse files Browse the repository at this point in the history
The forw_ref flag in struct insn was being set but never actually read
anywhere.

Signed-off-by: H. Peter Anvin <[email protected]>
  • Loading branch information
H. Peter Anvin committed Aug 10, 2024
1 parent 86142b0 commit 7c47273
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions asm/nasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,18 +1564,15 @@ static void forward_refs(insn *instruction)
int i;
struct forwrefinfo *fwinf;

instruction->forw_ref = false;

if (!optimizing.level)
return; /* For -O0 don't bother */
return; /* For -O1 don't bother */

if (!forwref)
return;

if (forwref->lineno != globallineno)
return;

instruction->forw_ref = true;
do {
instruction->oprs[forwref->operand].opflags |= OPFLAG_FORWARD;
forwref = saa_rstruct(forwrefs);
Expand Down
4 changes: 0 additions & 4 deletions asm/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ insn *parse_line(char *buffer, insn *result)

restart_parse:
first = true;
result->forw_ref = false;

stdscan_reset();
stdscan_set(buffer);
Expand Down Expand Up @@ -988,9 +987,6 @@ insn *parse_line(char *buffer, insn *result)
value = evaluate(stdscan, NULL, &tokval,
&op->opflags, critical, &hints);
i = tokval.t_type;
if (op->opflags & OPFLAG_FORWARD) {
result->forw_ref = true;
}
if (!value) /* Error in evaluator */
goto fail;

Expand Down
1 change: 0 additions & 1 deletion include/nasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,6 @@ typedef struct insn { /* an instruction itself */
extop *eops; /* extended operands */
int eops_float; /* true if DD and floating */
int32_t times; /* repeat count (TIMES prefix) */
bool forw_ref; /* is there a forward reference? */
bool rex_done; /* REX prefix emitted? */
int rex; /* Special REX Prefix */
int vexreg; /* Register encoded in VEX prefix */
Expand Down

0 comments on commit 7c47273

Please sign in to comment.