1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-26 13:10:22 +02:00

Correct wrong check in simplify_stxi.

* lib/lightning.c: Correct wrong check in simplify_stxi.
	The test was incorrectly comparing the target register
	and the displacement offset. This was a time bomb bug,
	that would trigger in code like:
		stxi Im0 Rb0 Rt0
		stxi Im1 Rb1 Rt1
	if Rb0 == Rb1 && Rt0 == Rt1 && Im0 == Rt1, that is,
	the wrong check was Im0 == Rt1, instead of the supposed
	Im0 == Imm1 (that was what the code mean't to do). It
	was removing the second stxi assuming it was redundantly
	generated; as that is not uncommon pattern on
	translators generating jit.
This commit is contained in:
Paulo Andrade 2015-02-03 15:19:21 -02:00
parent cdf5b785eb
commit 5724068b1c
2 changed files with 16 additions and 1 deletions

View file

@ -2790,7 +2790,7 @@ _simplify_stxi(jit_state_t *_jit, jit_node_t *prev, jit_node_t *node)
/* check for redundant store after load */
if (value->kind == jit_kind_code && value->code == node->code &&
value->base.q.l == right && value->base.q.h == _jitc->gen[right] &&
node->w.w == value->disp.w) {
node->u.w == value->disp.w) {
del_node(prev, node);
return (1);
}