summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorVictor van den Elzen <victor.vde@gmail.com>2009-02-23 04:35:00 +0100
committerVictor van den Elzen <victor.vde@gmail.com>2009-02-23 04:35:00 +0100
commitccafc3c4b75d8c26c2d57c2a4d39bb49cd76231c (patch)
treec7dee5e4ac8e5dcfeab6de462f5ef6078f391358 /assemble.c
parent79b59728248eb270247592cadef08bbd034f222c (diff)
downloadnasm-ccafc3c4b75d8c26c2d57c2a4d39bb49cd76231c.tar.gz
nasm-ccafc3c4b75d8c26c2d57c2a4d39bb49cd76231c.tar.bz2
nasm-ccafc3c4b75d8c26c2d57c2a4d39bb49cd76231c.zip
BR 2420167: jmp not always optimized
Begin by assuming short jumps are possible to prevent suboptimal convergence.
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/assemble.c b/assemble.c
index ad7ea70..748e62f 100644
--- a/assemble.c
+++ b/assemble.c
@@ -262,6 +262,11 @@ static bool jmp_match(int32_t segment, int64_t offset, int bits,
return false;
isize = calcsize(segment, offset, bits, ins, code);
+
+ if (ins->oprs[0].segment == NO_SEG)
+ /* Be optimistic in pass 1 */
+ return true;
+
if (ins->oprs[0].segment != segment)
return false;