[vlc-devel] [PATCH] skins2: os2: save and restore FPU cw

Jean-Baptiste Kempf jb at videolan.org
Sun Sep 28 16:58:50 CEST 2014


DOne.

On 12 Sep, KO Myung-Hun wrote :
> Backport to 2.2 tree, please...
> 
> KO Myung-Hun wrote:
> > WinCreateMsgQueue() changes FPU cw but does not restore it. This causes
> > SIGFPE later.
> > ---
> >  modules/gui/skins2/os2/os2_factory.cpp |    9 +++++++++
> >  1 files changed, 9 insertions(+), 0 deletions(-)
> > 
> > diff --git a/modules/gui/skins2/os2/os2_factory.cpp b/modules/gui/skins2/os2/os2_factory.cpp
> > index 61170eb..2cbfb85 100644
> > --- a/modules/gui/skins2/os2/os2_factory.cpp
> > +++ b/modules/gui/skins2/os2/os2_factory.cpp
> > @@ -31,6 +31,7 @@
> >  #include <io.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> > +#include <cfloat>
> >  
> >  #include "os2_factory.hpp"
> >  #include "os2_graphics.hpp"
> > @@ -169,8 +170,16 @@ bool OS2Factory::init()
> >      MorphToPM();
> >  
> >      m_hab = WinInitialize( 0 );
> > +
> > +    // save FPU CW
> > +    unsigned saved_cw = _control87( 0, 0 );
> > +
> > +    // WinCreateMsgQueue() changes FPU CW but does not restore it
> >      m_hmq = WinCreateMsgQueue( m_hab, 0 );
> >  
> > +    // restore FPU CW
> > +    _control87( saved_cw, MCW_EM | MCW_IC | MCW_RC | MCW_PC );
> > +
> >      if( !WinRegisterClass( m_hab, vlc_class, OS2Factory::OS2Proc,
> >                             CS_SIZEREDRAW, sizeof( PVOID )))
> >      {
> 
> -- 
> KO Myung-Hun
> 
> Using Mozilla SeaMonkey 2.7.2
> Under OS/2 Warp 4 for Korean with FixPak #15
> In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM
> 
> Korean OS/2 User Community : http://www.ecomstation.co.kr
> 

> >From 6bb7e156a99b6674f93f0ed11cc63de9efca5772 Mon Sep 17 00:00:00 2001
> From: KO Myung-Hun <komh78 at gmail.com>
> Date: Wed, 10 Sep 2014 17:00:49 +0900
> Subject: [PATCH] skins2: os2: save and restore FPU cw
> 
> WinCreateMsgQueue() changes FPU cw but does not restore it. This causes
> SIGFPE later.
> 
> Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> (cherry picked from commit c35f6c1be0c06204a7b9787695cfa1150c5e5f90)
> 
> Signed-off-by: KO Myung-Hun <komh at chollian.net>
> ---
>  modules/gui/skins2/os2/os2_factory.cpp |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/modules/gui/skins2/os2/os2_factory.cpp b/modules/gui/skins2/os2/os2_factory.cpp
> index 61170eb..2cbfb85 100644
> --- a/modules/gui/skins2/os2/os2_factory.cpp
> +++ b/modules/gui/skins2/os2/os2_factory.cpp
> @@ -31,6 +31,7 @@
>  #include <io.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
> +#include <cfloat>
>  
>  #include "os2_factory.hpp"
>  #include "os2_graphics.hpp"
> @@ -169,8 +170,16 @@ bool OS2Factory::init()
>      MorphToPM();
>  
>      m_hab = WinInitialize( 0 );
> +
> +    // save FPU CW
> +    unsigned saved_cw = _control87( 0, 0 );
> +
> +    // WinCreateMsgQueue() changes FPU CW but does not restore it
>      m_hmq = WinCreateMsgQueue( m_hab, 0 );
>  
> +    // restore FPU CW
> +    _control87( saved_cw, MCW_EM | MCW_IC | MCW_RC | MCW_PC );
> +
>      if( !WinRegisterClass( m_hab, vlc_class, OS2Factory::OS2Proc,
>                             CS_SIZEREDRAW, sizeof( PVOID )))
>      {
> -- 
> 1.7.3.2
> 

> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list