summaryrefslogtreecommitdiffstats
path: root/lib/msun/i387
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2005-05-06 15:44:20 +0000
committerdeischen <deischen@FreeBSD.org>2005-05-06 15:44:20 +0000
commit5d3cf2651982d54876d10fffdc1864d9bdbdc2e2 (patch)
tree913bf781857d9ed7dee290f655f559a7fa1035bd /lib/msun/i387
parentc1d1198668b10f97978f541a170bb9327ed530c4 (diff)
downloadFreeBSD-src-5d3cf2651982d54876d10fffdc1864d9bdbdc2e2.zip
FreeBSD-src-5d3cf2651982d54876d10fffdc1864d9bdbdc2e2.tar.gz
Prevent these functions from using stack outside of their frame.
Reported by: Marc Olzheim <marcolz at stack dot nl> OK'd by: das
Diffstat (limited to 'lib/msun/i387')
-rw-r--r--lib/msun/i387/s_ceilf.S10
-rw-r--r--lib/msun/i387/s_floorf.S10
-rw-r--r--lib/msun/i387/s_truncf.S10
3 files changed, 15 insertions, 15 deletions
diff --git a/lib/msun/i387/s_ceilf.S b/lib/msun/i387/s_ceilf.S
index 0b15a1f..473d309 100644
--- a/lib/msun/i387/s_ceilf.S
+++ b/lib/msun/i387/s_ceilf.S
@@ -13,17 +13,17 @@ ENTRY(ceilf)
movl %esp,%ebp
subl $8,%esp
- fstcw -12(%ebp) /* store fpu control word */
- movw -12(%ebp),%dx
+ fstcw -4(%ebp) /* store fpu control word */
+ movw -4(%ebp),%dx
orw $0x0800,%dx /* round towards +oo */
andw $0xfbff,%dx
- movw %dx,-16(%ebp)
- fldcw -16(%ebp) /* load modfied control word */
+ movw %dx,-8(%ebp)
+ fldcw -8(%ebp) /* load modfied control word */
flds 8(%ebp); /* round */
frndint
- fldcw -12(%ebp) /* restore original control word */
+ fldcw -4(%ebp) /* restore original control word */
leave
ret
diff --git a/lib/msun/i387/s_floorf.S b/lib/msun/i387/s_floorf.S
index 64a1031..f1000fe 100644
--- a/lib/msun/i387/s_floorf.S
+++ b/lib/msun/i387/s_floorf.S
@@ -13,17 +13,17 @@ ENTRY(floorf)
movl %esp,%ebp
subl $8,%esp
- fstcw -12(%ebp) /* store fpu control word */
- movw -12(%ebp),%dx
+ fstcw -4(%ebp) /* store fpu control word */
+ movw -4(%ebp),%dx
orw $0x0400,%dx /* round towards -oo */
andw $0xf7ff,%dx
- movw %dx,-16(%ebp)
- fldcw -16(%ebp) /* load modfied control word */
+ movw %dx,-8(%ebp)
+ fldcw -8(%ebp) /* load modfied control word */
flds 8(%ebp); /* round */
frndint
- fldcw -12(%ebp) /* restore original control word */
+ fldcw -4(%ebp) /* restore original control word */
leave
ret
diff --git a/lib/msun/i387/s_truncf.S b/lib/msun/i387/s_truncf.S
index b732908..0001367 100644
--- a/lib/msun/i387/s_truncf.S
+++ b/lib/msun/i387/s_truncf.S
@@ -11,16 +11,16 @@ ENTRY(truncf)
movl %esp,%ebp
subl $8,%esp
- fstcw -12(%ebp) /* store fpu control word */
- movw -12(%ebp),%dx
+ fstcw -4(%ebp) /* store fpu control word */
+ movw -4(%ebp),%dx
orw $0x0c00,%dx /* round towards -oo */
- movw %dx,-16(%ebp)
- fldcw -16(%ebp) /* load modfied control word */
+ movw %dx,-8(%ebp)
+ fldcw -8(%ebp) /* load modfied control word */
flds 8(%ebp) /* round */
frndint
- fldcw -12(%ebp) /* restore original control word */
+ fldcw -4(%ebp) /* restore original control word */
leave
ret
OpenPOWER on IntegriCloud