Patchwork [1/4] powerpc: Fix thinko in _stp_arg()

login
register
mail settings
Submitter Anton Vorontsov
Date Dec. 3, 2009, 11:31 p.m.
Message ID <20091203233151.GA3416@oksana.dev.rtsoft.ru>
Download mbox | patch
Permalink /patch/40280/
State Not Applicable
Headers show

Comments

Anton Vorontsov - Dec. 3, 2009, 11:31 p.m.
_stp_arg() has an almost unnoticeable thinko in the argnum handling,
which causes it to always return u_register("r10"):

'else (argnum == 8)' should actually be 'else if (argnum == 8)'.

Though, since we check for 'if (argnum < 1 || argnum > 8)' at the
beginning of _stp_arg(), let's make it just 'else'.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 tapset/powerpc/registers.stp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Ananth N Mavinakayanahalli - Dec. 4, 2009, 4:21 a.m.
On Fri, Dec 04, 2009 at 02:31:51AM +0300, Anton Vorontsov wrote:
> _stp_arg() has an almost unnoticeable thinko in the argnum handling,
> which causes it to always return u_register("r10"):
> 
> 'else (argnum == 8)' should actually be 'else if (argnum == 8)'.
> 
> Though, since we check for 'if (argnum < 1 || argnum > 8)' at the
> beginning of _stp_arg(), let's make it just 'else'.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>

Ugh! What was I thinking?

Thanks for fixing this Anton.

Ananth

Patch

diff --git a/tapset/powerpc/registers.stp b/tapset/powerpc/registers.stp
index c8713e5..7f66d36 100644
--- a/tapset/powerpc/registers.stp
+++ b/tapset/powerpc/registers.stp
@@ -146,7 +146,7 @@  function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) {
 		val = u_register("r8")
 	else if (argnum == 7)
 		val = u_register("r9")
-	else (argnum == 8)
+	else
 		val = u_register("r10")
 
 	if (truncate) {