[hackers] [scc/qbe] [cc2-qbe] Fix lhs() with OMEM or OAUTO || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 17 Aug 2016 16:07:19 +0200 (CEST)

commit fa3a69095e3c841ba8bfc3a099c66e8f0112e47b
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Aug 17 15:52:51 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Aug 17 15:52:51 2016 +0200

    [cc2-qbe] Fix lhs() with OMEM or OAUTO
    
    Lhs() must put its return value in new, because callers expect that.

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index 3617e77..522e2ed 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
_AT_@ -307,6 +307,7 @@ lhs(Node *np, Node *new)
         switch (np->op) {
         case OMEM:
         case OAUTO:
+ *new = *np;
                 return np;
         case OPTR:
                 return rhs(np->left, new);
Received on Wed Aug 17 2016 - 16:07:19 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 17 2016 - 16:12:16 CEST