diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 3bac66a8..59a36be5 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -675,7 +675,8 @@ bytecode_parser_finalize_insn(bytecode *bc) if (ea) { if ((ea->disp) && ((!ea->valid_sib && ea->need_sib) || (!ea->valid_modrm && ea->need_modrm))) { - /* First simplify expression to minimize check cost */ + /* First expand equ's and simplify expression */ + expr_expand_equ(ea->disp); expr_simplify(ea->disp); /* Check validity of effective address and calc R/M bits of diff --git a/src/bytecode.c b/src/bytecode.c index 3bac66a8..59a36be5 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -675,7 +675,8 @@ bytecode_parser_finalize_insn(bytecode *bc) if (ea) { if ((ea->disp) && ((!ea->valid_sib && ea->need_sib) || (!ea->valid_modrm && ea->need_modrm))) { - /* First simplify expression to minimize check cost */ + /* First expand equ's and simplify expression */ + expr_expand_equ(ea->disp); expr_simplify(ea->disp); /* Check validity of effective address and calc R/M bits of