Improve accuracy of simulation of bsf/bsr instructions when the word
being scanned is zero.  (Zoltan Hidvegi)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@205 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/vg_helpers.S b/vg_helpers.S
index e802081..62db9ec 100644
--- a/vg_helpers.S
+++ b/vg_helpers.S
@@ -343,16 +343,18 @@
 .global VG_(helper_bsr)
 VG_(helper_bsr):
 	pushl	%eax
+	movl	12(%esp), %eax
 	bsrl	8(%esp), %eax
-	movl	%eax, 8(%esp)
+	movl	%eax, 12(%esp)
 	popl	%eax
 	ret
 
 .global VG_(helper_bsf)
 VG_(helper_bsf):
 	pushl	%eax
+	movl	12(%esp), %eax
 	bsfl	8(%esp), %eax
-	movl	%eax, 8(%esp)
+	movl	%eax, 12(%esp)
 	popl	%eax
 	ret