Module Name:    src
Committed By:   pooka
Date:           Tue Sep  7 20:35:51 UTC 2010

Modified Files:
        src/sys/lib/libkern/arch/i386: random.S

Log Message:
Rename jump label to something a little more negative.  No, I'm
not doing it for cosmetic value or out of angst.  See, PIC_PROLOGUE
on i386 uses the "1" label internally.  Now, everything would be
fine and dandy for the first 551245 calls to random.  After that
p+q is negative and the jump is taken.  However, it is taken into
the middle of PIC_PROLOGUE instead of where upon superficial
examination we assumed we are jumping.  This causes wrong(tm) things
to happen and "ret" triggers a jump into hyperspace.

(no, I did not see that coming)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/lib/libkern/arch/i386/random.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/arch/i386/random.S
diff -u src/sys/lib/libkern/arch/i386/random.S:1.5 src/sys/lib/libkern/arch/i386/random.S:1.6
--- src/sys/lib/libkern/arch/i386/random.S:1.5	Sun Jan  4 17:10:46 2009
+++ src/sys/lib/libkern/arch/i386/random.S	Tue Sep  7 20:35:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: random.S,v 1.5 2009/01/04 17:10:46 pooka Exp $	*/
+/*	$NetBSD: random.S,v 1.6 2010/09/07 20:35:50 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -83,12 +83,12 @@
 	shld	$1,%eax,%edx
 	andl	$0x7fffffff,%eax
 	addl	%edx,%eax
-	js	1f
+	js	neg
 	PIC_PROLOGUE
 	movl	%eax,PIC_GOTOFF(randseed)
 	PIC_EPILOGUE
 	ret
-1:
+neg:
 	subl	$0x7fffffff,%eax
 	PIC_PROLOGUE
 	movl	%eax,PIC_GOTOFF(randseed)

Reply via email to