diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-12-18 11:12:46 -0800 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-12-18 11:14:59 -0800 |
commit | e55d03dd47c221f631fe518c623cdd8a703076b2 (patch) | |
tree | a8dad51972e4dd49b401afcc0f08ce4b53b331f1 /asm/parser.c | |
parent | 8c17bb2fc4d61675b6775e78fbb37b48f19379d3 (diff) | |
download | nasm-e55d03dd47c221f631fe518c623cdd8a703076b2.tar.gz |
Clean up the handling of various passes
The use of pass0, pass1, pass2, and "pass" passed as an argument is
really confusing and already caused a severe bug in the 2.14.01
release cycle. Clean them up and be far more explicit about what
various passes mean.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'asm/parser.c')
-rw-r--r-- | asm/parser.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/asm/parser.c b/asm/parser.c index 74ea77c9..9c96732d 100644 --- a/asm/parser.c +++ b/asm/parser.c @@ -415,12 +415,12 @@ static int value_to_extop(expr * vect, extop *eop, int32_t myseg) return 0; } -insn *parse_line(int pass, char *buffer, insn *result) +insn *parse_line(char *buffer, insn *result) { bool insn_is_label = false; struct eval_hints hints; int opnum; - int critical; + bool critical; bool first; bool recover; int i; @@ -501,7 +501,7 @@ restart_parse: expr *value; i = stdscan(NULL, &tokval); - value = evaluate(stdscan, NULL, &tokval, NULL, pass0, NULL); + value = evaluate(stdscan, NULL, &tokval, NULL, pass_stable(), NULL); i = tokval.t_type; if (!value) /* Error in evaluator */ goto fail; @@ -566,11 +566,7 @@ restart_parse: * `critical' flag on calling evaluate(), so that it will bomb * out on undefined symbols. */ - if (result->opcode == I_INCBIN) { - critical = (pass0 < 2 ? 1 : 2); - - } else - critical = (pass == 2 ? 2 : 0); + critical = pass_final() || (result->opcode == I_INCBIN); if (opcode_is_db(result->opcode) || result->opcode == I_INCBIN) { extop *eop, **tail = &result->eops, **fixptr; |