This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix oddity in personality routine


On Fri, Nov 13, 2009 at 06:50:03PM +0100, Eric Botcazou wrote:
> Hi,
> 
> r128098 has introduced an oddity in the personality routine:
> 
>   int ip_before_insn = 0;
> [...]
> 
>   // Parse the LSDA header.
>   p = parse_lsda_header (context, language_specific_data, &info);
> #ifdef HAVE_GETIPINFO
>   ip = _Unwind_GetIPInfo (context, &ip_before_insn);
> #else
>   ip = _Unwind_GetIP (context) - 1;
> #endif
>   if (! ip_before_insn)
>     --ip;
> 
> So, if !HAVE_GETIPINFO, the IP is decremented by 2!  It used to be 1 and both 
> libstdc++-v3/libsupc++/eh_personality.cc and ada/raise-gcc.c have the expected 
> version:
> 
> #ifdef _GLIBCXX_HAVE_GETIPINFO
>   ip = _Unwind_GetIPInfo (context, &ip_before_insn);
> #else
>   ip = _Unwind_GetIP (context);
> #endif
>   if (! ip_before_insn)
>     --ip;
> 
> Hence the attached patch, that I don't plan to test though.  OK anyway?
> 
> 
> 2009-11-13  Eric Botcazou  <ebotcazou@adacore.com>
> 
> 	* exception.cc (PERSONALITY_FUNCTION): Fix oversight.
> 
> 
> -- 
> Eric Botcazou

> Index: exception.cc
> ===================================================================
> --- exception.cc	(revision 154059)
> +++ exception.cc	(working copy)
> @@ -328,7 +328,7 @@ PERSONALITY_FUNCTION (int version,
>  #ifdef HAVE_GETIPINFO
>    ip = _Unwind_GetIPInfo (context, &ip_before_insn);
>  #else
> -  ip = _Unwind_GetIP (context) - 1;
> +  ip = _Unwind_GetIP (context);
>  #endif
>    if (! ip_before_insn)
>      --ip;


Shouldn't this fix also get backported to gcc-4_4-branch and 
gcc-4_3-branch as well? They both have r128098.
               Jack


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]