summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2025-08-05 01:39:26 -0400
committerWormHeamer2025-08-05 01:39:26 -0400
commitdef1b9179981081f67ed654f65ef22a55f6cdcb3 (patch)
tree2850976304a4d0d240ca6860161d21dd6520f5aa
parentbeee7d5d34d6d37649b544de33db36f389648897 (diff)
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!
-rw-r--r--ir.c2
1 files changed, 1 insertions, 1 deletions
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;
}