shithub: scc

Download patch

ref: 2abe3c04e394a50485d96cc1063bdeae6fdeaca0
parent: 769ca1ed6d4bb1d3fa631a0a4f770b441161b924
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Aug 17 11:52:51 EDT 2016

[cc2-qbe] Fix lhs() with OMEM or OAUTO

Lhs() must put its return value in new, because callers expect that.

--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -307,6 +307,7 @@
 	switch (np->op) {
 	case OMEM:
 	case OAUTO:
+		*new = *np;
 		return np;
 	case OPTR:
 		return rhs(np->left, new);