shithub: mc

Download patch

ref: df3dc5078c090ea2d9cef6c33cf157975d29bd4f
parent: c903ba47cf1e54d18727f493a5beca2ccf5e33fc
author: Ori Bernstein <[email protected]>
date: Mon Jul 30 20:20:19 EDT 2012

Prevent return values from clobbering things.

--- a/8/isel.c
+++ b/8/isel.c
@@ -357,7 +357,10 @@
     size_t i;
 
     rsp = locphysreg(Rrsp);
-    rax = locphysreg(Rrax);
+    if (tybase(exprtype(n))->type == Tyvoid)
+        rax = NULL;
+    else
+        rax = coreg(Rrax, mode(n));
     argsz = 0;
     /* Have to calculate the amount to bump the stack
      * pointer by in one pass first, otherwise if we push