From def1b9179981081f67ed654f65ef22a55f6cdcb3 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Tue, 5 Aug 2025 01:39:26 -0400 Subject: tragic realization: = and <> aren't communative at all i assumed they were because it kinda makes sense to write something like "a = b = c", but "a = (b = c)" and "(a = b) = c" are very very different expressions. whoops! --- ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ir.c') diff --git a/ir.c b/ir.c index 7e7604b..e1b86c6 100644 --- a/ir.c +++ b/ir.c @@ -245,7 +245,7 @@ Node *node_new_lit_bool(Proc *p, int b) { } static inline int node_op_communative(NodeType t) { - NodeType ops[] = { N_OP_ADD, N_OP_MUL, N_OP_AND, N_OP_XOR, N_OP_OR, N_CMP_EQL, N_CMP_NEQ }; + NodeType ops[] = { N_OP_ADD, N_OP_MUL, N_OP_AND, N_OP_XOR, N_OP_OR }; for (unsigned i = 0; i < sizeof ops / sizeof *ops; i++) { if (ops[i] == t) return 1; } -- cgit v1.2.3