summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-04-30 20:53:16 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-04-30 20:53:16 +0000
commit87bc61964cf5d2cc2e322883d6f927a43fb53af3 (patch)
treecf5f2e9602092902807762c09912a5e520121368 /parser.c
parent76690a12ad212d1f77cd1f71d7ac5a9de6eaefb6 (diff)
downloadnasm-87bc61964cf5d2cc2e322883d6f927a43fb53af3.tar.gz
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index db465cd9..d7bbdb0c 100644
--- a/parser.c
+++ b/parser.c
@@ -179,7 +179,7 @@ insn *parse_line (int pass, char *buffer, insn *result,
result->opcode == I_DQ ||
result->opcode == I_DT ||
result->opcode == I_INCBIN) {
- extop *eop, **tail = &result->eops;
+ extop *eop, **tail = &result->eops, **fixptr;
int oper_num = 0;
/*
@@ -189,6 +189,7 @@ insn *parse_line (int pass, char *buffer, insn *result,
i = stdscan(NULL, &tokval);
if (i == 0)
break;
+ fixptr = tail;
eop = *tail = nasm_malloc(sizeof(extop));
tail = &eop->next;
eop->next = NULL;
@@ -231,6 +232,8 @@ insn *parse_line (int pass, char *buffer, insn *result,
eop->type = EOT_NOTHING;
}
eop = nasm_realloc(eop, sizeof(extop)+eop->stringlen);
+ tail = &eop->next;
+ *fixptr = eop;
eop->stringval = (char *)eop + sizeof(extop);
if (!float_const (tokval.t_charptr, sign,
(unsigned char *)eop->stringval,