shithub: scc

Download patch

ref: 41ed50efbfd832c5c4efd7615ac46c798d6ce76d
parent: 056b7ad0b618f1f41622629a7f30d408761e73ef
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Nov 16 03:02:22 EST 2021

cc1: Fix order of parameters in pcompare()

Pcompare() expects first left and right parameters, but it was
called with right and left.

--- a/src/cmd/cc/cc1/expr.c
+++ b/src/cmd/cc/cc1/expr.c
@@ -368,7 +368,7 @@
 	rtp = rp->type;
 
 	if (ltp->op == PTR || rtp->op == PTR) {
-		return pcompare(op, rp, lp);
+		return pcompare(op, lp, rp);
 	} else if ((ltp->prop & TARITH) && (rtp->prop & TARITH)) {
 		arithconv(&lp, &rp);
 		return convert(node(op, lp->type, lp, rp), inttype, 1);;