summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorCharles Crayne <chuck@thor.crayne.org>2008-09-10 19:21:52 -0700
committerCharles Crayne <chuck@thor.crayne.org>2008-09-10 19:21:52 -0700
commit2581c869b1ceabdc243f88b9b72d81554bc6a35a (patch)
treef5aeb05f87a70273fb2158361f7dfa89f43da02e /parser.c
parent325a4bff508e5cdf8804c6ea3ce6b8eb08110625 (diff)
downloadnasm-2581c869b1ceabdc243f88b9b72d81554bc6a35a.tar.gz
Decouple forward references from optimization
Users who wish to control the level of optimization can continue to specify -O0, -O1, or -Ox, where x can be the letter itself, or any number > 1. However, even with optimization turned off, NASM will always make enough passes to resolve forward references. As a result, INCBIN is now the only item left in the critical expressions list, although TIMES still has its own constant value check.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/parser.c b/parser.c
index a88e8837..7e5c9a32 100644
--- a/parser.c
+++ b/parser.c
@@ -308,21 +308,13 @@ restart_parse:
result->condition = tokval.t_inttwo;
/*
- * RESB, RESW and RESD cannot be satisfied with incorrectly
+ * INCBIN cannot be satisfied with incorrectly
* evaluated operands, since the correct values _must_ be known
* on the first pass. Hence, even in pass one, we set the
* `critical' flag on calling evaluate(), so that it will bomb
- * out on undefined symbols. Nasty, but there's nothing we can
- * do about it.
- *
- * For the moment, EQU has the same difficulty, so we'll
- * include that.
+ * out on undefined symbols.
*/
- if (result->opcode == I_RESB || result->opcode == I_RESW ||
- result->opcode == I_RESD || result->opcode == I_RESQ ||
- result->opcode == I_REST || result->opcode == I_RESO ||
- result->opcode == I_RESY ||
- result->opcode == I_INCBIN) {
+ if (result->opcode == I_INCBIN) {
critical = (pass0 < 2 ? 1 : 2);
} else