shithub: scc

Download patch

ref: 4119797b7b822ec09e1d8b1069d80f4737bfac16
parent: 392cc961cb76599a756e455697543779308a16f8
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Jan 20 05:00:05 EST 2017

[cc2-qbe] fix OCOMMA operator

Calling rhs() from rhs() with the same parameters was a really bad
idea.

--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -589,7 +589,8 @@
 	case OASK:
 		return ternary(np, ret);
 	case OCOMMA:
-		return rhs(np, ret);
+		rhs(l, &aux1);
+		return rhs(r, ret);
 	case OPTR:
 		return load(tp, rhs(l, &aux1), ret);
 	case OADDR: