}
/* Near jump, no spans needed */
+ if (jmp->shortop.len == 0)
+ jmp->op_sel = JMP_NEAR;
bc->len += jmp->nearop.len;
bc->len += (opersize == 16) ? 2 : 4;
return 0;
&& (!yasm_symrec_get_label(jmp->target.rel, &target_prevbc)
|| target_prevbc->section != bc->section)) {
/* External or out of segment, so we can't check distance.
- * Allowing forced short jumps depends on the objfmt supporting
+ * Allowing short jumps depends on the objfmt supporting
* 8-bit relocs. While most don't, some might, so allow it here.
* Otherwise default to word-sized.
* The objfmt will error if not supported.
*/
if (jmp->op_sel == JMP_SHORT_FORCED || jmp->nearop.len == 0) {
+ if (jmp->nearop.len == 0)
+ jmp->op_sel = JMP_SHORT;
bc->len += jmp->shortop.len + 1;
} else {
+ jmp->op_sel = JMP_NEAR;
bc->len += jmp->nearop.len;
bc->len += (opersize == 16) ? 2 : 4;
}