diff --git a/libyasm/expr.c b/libyasm/expr.c index 531ad604..262863e8 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -339,6 +339,12 @@ expr_bc_dist_subst_cb(yasm_expr__item *ei, yasm_bytecode *precbc, return 1; } +static yasm_expr * +expr_xform_bc_dist_subst(yasm_expr *e, void *d) +{ + return expr_xform_bc_dist_base(e, d, expr_bc_dist_subst_cb); +} + int yasm_expr__bc_dist_subst(yasm_expr **ep, void *cbd, void (*callback) (unsigned int subst, @@ -350,7 +356,8 @@ yasm_expr__bc_dist_subst(yasm_expr **ep, void *cbd, my_cbd.callback = callback; my_cbd.cbd = cbd; my_cbd.subst = 0; - *ep = expr_xform_bc_dist_base(*ep, &my_cbd, expr_bc_dist_subst_cb); + *ep = yasm_expr__level_tree(*ep, 1, 1, 1, 0, &expr_xform_bc_dist_subst, + &my_cbd, NULL); return my_cbd.subst; } diff --git a/libyasm/tests/Makefile.inc b/libyasm/tests/Makefile.inc index e8b057ea..f34f651c 100644 --- a/libyasm/tests/Makefile.inc +++ b/libyasm/tests/Makefile.inc @@ -45,6 +45,8 @@ EXTRA_DIST += libyasm/tests/opt-immexpand.asm EXTRA_DIST += libyasm/tests/opt-immexpand.hex EXTRA_DIST += libyasm/tests/opt-immnoexpand.asm EXTRA_DIST += libyasm/tests/opt-immnoexpand.hex +EXTRA_DIST += libyasm/tests/opt-oldalign.asm +EXTRA_DIST += libyasm/tests/opt-oldalign.hex EXTRA_DIST += libyasm/tests/opt-struc.asm EXTRA_DIST += libyasm/tests/opt-struc.hex EXTRA_DIST += libyasm/tests/timesover-err.asm diff --git a/libyasm/tests/opt-oldalign.asm b/libyasm/tests/opt-oldalign.asm new file mode 100644 index 00000000..013a5c83 --- /dev/null +++ b/libyasm/tests/opt-oldalign.asm @@ -0,0 +1,3 @@ +mov ax, 5 +times ($$-$) & 1Fh nop ; Long word alignment +mov bx, 5 diff --git a/libyasm/tests/opt-oldalign.hex b/libyasm/tests/opt-oldalign.hex new file mode 100644 index 00000000..dfbb9da9 --- /dev/null +++ b/libyasm/tests/opt-oldalign.hex @@ -0,0 +1,35 @@ +b8 +05 +00 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +90 +bb +05 +00