[qfcc] Respect commutativity when optimizing adds

This fixes the really odd bug of certain string values getting swapped
in vkgen when DEBUG_QF_MEMORY was defined in expr.c. It will also
prevent a lot of fun with floats in the future, I imagine.
This commit is contained in:
Bill Currie 2023-10-02 22:33:29 +09:00
parent 0974983a39
commit 360dfc0038

View file

@ -550,8 +550,10 @@ optimize_core (const expr_t *expr)
optimize_extends (adds);
optimize_extends (subs);
optimize_adds (adds);
optimize_adds (subs);
if (expr->expr.commutative) {
optimize_adds (adds);
optimize_adds (subs);
}
optimize_cross_products (adds, subs);
optimize_scale_products (adds, subs);