summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorVictor van den Elzen <victor.vde@gmail.com>2009-02-25 17:32:00 +0100
committerVictor van den Elzen <victor.vde@gmail.com>2009-02-25 17:32:00 +0100
commit154e5920a1ee2c816e502b70fe0c4ab3ea6ab7c1 (patch)
tree7c20d04a4f5b12241c58b54fd03d0d0ea3a030e0 /parser.c
parentbabebffb71f42e1d55095afea96f41e15acc28b1 (diff)
downloadnasm-154e5920a1ee2c816e502b70fe0c4ab3ea6ab7c1.tar.gz
Do not confuse segmentless adresses and unknown forward references
Also be optimistic with immediate forward references.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index 91b7abf5..0f640430 100644
--- a/parser.c
+++ b/parser.c
@@ -737,6 +737,7 @@ restart_parse:
return result;
} else {
if (e->type == EXPR_UNKNOWN) {
+ result->oprs[operand].opflags |= OPFLAG_UNKNOWN;
o = 0; /* doesn't matter what */
result->oprs[operand].wrt = NO_SEG; /* nor this */
result->oprs[operand].segment = NO_SEG; /* or this */
@@ -818,9 +819,16 @@ restart_parse:
if (is_just_unknown(value)) { /* it's immediate but unknown */
result->oprs[operand].type |= IMMEDIATE;
+ result->oprs[operand].opflags |= OPFLAG_UNKNOWN;
result->oprs[operand].offset = 0; /* don't care */
result->oprs[operand].segment = NO_SEG; /* don't care again */
result->oprs[operand].wrt = NO_SEG; /* still don't care */
+
+ if(optimizing >= 0 && !(result->oprs[operand].type & STRICT))
+ {
+ /* Be optimistic */
+ result->oprs[operand].type |= SBYTE16 | SBYTE32 | SBYTE64;
+ }
} else if (is_reloc(value)) { /* it's immediate */
result->oprs[operand].type |= IMMEDIATE;
result->oprs[operand].offset = reloc_value(value);