From 7f8fa2cf47830efd49387cdacc6075275ed91e92 Mon Sep 17 00:00:00 2001 From: Daniel Eischen Date: Fri, 6 May 2005 15:44:20 +0000 Subject: [PATCH] Prevent these functions from using stack outside of their frame. Reported by: Marc Olzheim OK'd by: das --- lib/msun/i387/s_ceilf.S | 10 +++++----- lib/msun/i387/s_floorf.S | 10 +++++----- lib/msun/i387/s_truncf.S | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/msun/i387/s_ceilf.S b/lib/msun/i387/s_ceilf.S index 0b15a1f4c28b..473d30951d2b 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 64a1031f6b58..f1000fef7659 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 b7329081a8f6..000136738dfc 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