Re: [ros-dev] [ros-diffs] [tkreuzer] 64078: [PSEH] - On clang builds we need to do the return twice trick, since we don't have asm goto, which would allow us to specify labels in the code where we can
Making the member conditional but writing to it unconditionally seems like it would overflow the stack variable on GCC? On 2014-09-07 23:40, tkreu...@svn.reactos.org wrote: > +#ifdef __clang__ > +void *ReturnAddress; > #endif > +/* Safe the return address */ > +mov ebx, [esp] > +mov [eax + SEH3_REGISTRATION_FRAME_ReturnAddress], ebx ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [tkreuzer] 64078: [PSEH] - On clang builds we need to do the return twice trick, since we don't have asm goto, which would allow us to specify labels in the code where we can
The function is only called when the exception registration frame is marked as a Clang registration frame. The lib handles different registration frames, which is required for C vs C++ and I chose to keep this for Clang, to be able to mix GCC and Clang compiled object files in a single module. I'll add comments and I might rename the function, too. Am 08.09.2014 10:27, schrieb Thomas Faber: > Making the member conditional but writing to it unconditionally seems > like it would overflow the stack variable on GCC? > > On 2014-09-07 23:40, tkreu...@svn.reactos.org wrote: >> +#ifdef __clang__ >> +void *ReturnAddress; >> #endif > >> +/* Safe the return address */ >> +mov ebx, [esp] >> +mov [eax + SEH3_REGISTRATION_FRAME_ReturnAddress], ebx > > ___ > Ros-dev mailing list > Ros-dev@reactos.org > http://www.reactos.org/mailman/listinfo/ros-dev > ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [tkreuzer] 64078: [PSEH] - On clang builds we need to do the return twice trick, since we don't have asm goto, which would allow us to specify labels in the code where we can
On 2014-09-07 23:40, tkreu...@svn.reactos.org wrote: > --- trunk/reactos/lib/pseh/i386/pseh3_i386.S [iso-8859-1] (original) > +++ trunk/reactos/lib/pseh/i386/pseh3_i386.S [iso-8859-1] Sun Sep 7 > 21:40:07 2014 > @@ -30,6 +30,10 @@ > mov [eax + SEH3_REGISTRATION_FRAME_Esi], esi > mov [eax + SEH3_REGISTRATION_FRAME_Edi], edi > > +/* Safe the return address */ > +mov ebx, [esp] > +mov [eax + SEH3_REGISTRATION_FRAME_ReturnAddress], ebx > + > .global __SEH3$_RegisterFrameWithStackLayout > __SEH3$_RegisterFrameWithStackLayout: > I think we need to restore ebx before returning? I don't see us telling the compiler that it was clobbered anywhere. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev