This patch looks fine to me.
在 2010年12月13日 下午5:53,朱庆 <[email protected]>写道:
> Hi,
>
> Can you help review this?
> fix the problem caused by r3432 in ccvs testing.
> replace Get_ST() with DECL_ST(), the first one will create a new st if it
> is null.
>
> new patch:
> Index: wgen_expr.cxx
> ===================================================================
> --- wgen_expr.cxx (revision 3432)
>
> +++ wgen_expr.cxx (working copy)
> @@ -2605,7 +2605,8 @@
>
> case GS_FUNCTION_DECL:
> {
> st = Get_ST (arg0);
> - ST *real_st = gs_decl_alias_target(arg0)?
> Get_ST(gs_decl_alias_target(arg0)):st;
> + gs_t alias_target = gs_decl_alias_target(arg0);
> + ST *real_st = (alias_target && DECL_ST(alias_target))?
> DECL_ST(alias_target):st;
>
> ty_idx = ST_type (st);
> #ifdef KEY
> // Arg0 is the virtual function table (vtable) for a class.
> Initialize
>
>
> 在 2010年12月10日 上午1:24,Jian-Xin Lai <[email protected]>写道:
>
> It looks fine to me. Please go ahead and commit it. Thank you very much.
>>
>> 2010/12/8 朱庆 <[email protected]>
>>
>>> Hi all,
>>>
>>>
>>> Can gatekeeper help review this fix?
>>>
>>> Bug link: https://bugs.open64.net/show_bug.cgi?id=649
>>>
>>> A small case:
>>>
>>> 1 namespace pcrecpp {
>>> 2 class Arg { public: Arg(); Arg(void*); };
>>> 3 class RE { static Arg no_arg; };
>>> 4 Arg RE::no_arg((void*)__null);
>>> 5 extern Arg no_arg __attribute__((alias("" "_ZN7pcrecpp2RE6no_argE")));
>>> 6 }
>>> The wn for line5 is:
>>> U8U8LDID 0 <1,52,_ZN7pcrecpp2RE6no_argE> T<54,Arg,1>
>>> it uses the base st(_ZN7pcrecpp2RE6no_argE) instead of
>>> _ZN7pcrecpp6no_argE
>>> I think the right one should be like this:
>>> U8LDA 0 <1,54,_ZN7pcrecpp6no_argE> T<55,anon_ptr.,8>
>>>
>>> The ori code did not consider the alias situation.
>>>
>>> Here is the patch:
>>> Index: wgen_expr.cxx
>>> ===================================================================
>>> --- wgen_expr.cxx (revision 3426)
>>> +++ wgen_expr.cxx (working copy)
>>> @@ -2605,6 +2605,7 @@
>>> case GS_FUNCTION_DECL:
>>> {
>>> st = Get_ST (arg0);
>>> + ST *real_st = gs_decl_alias_target(arg0)?
>>> Get_ST(gs_decl_alias_target(arg0)):st;
>>> ty_idx = ST_type (st);
>>> #ifdef KEY
>>> // Arg0 is the virtual function table (vtable) for a class.
>>> Initialize
>>> @@ -2632,7 +2633,7 @@
>>> #endif
>>> // for VLAs, use the base_st instead of st
>>> if (code0 == GS_VAR_DECL &&
>>> - st != ST_base(st)) {
>>> + real_st != ST_base(st)) {
>>> FmtAssert (ST_ofst (st) == 0,
>>> ("Variable Length Arrays within struct not currently
>>> implemented"));
>>> wn = WN_Ldid (Pointer_Mtype, 0, ST_base(st),
>>> ST_type(ST_base(st)));
>>>
>>> Thanks,
>>> zhuqing
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF Dev2Dev email is sponsored by:
>>>
>>> WikiLeaks The End of the Free Internet
>>> http://p.sf.net/sfu/therealnews-com
>>> _______________________________________________
>>> Open64-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/open64-devel
>>>
>>>
>>
>>
>> --
>> Regards,
>> Lai Jian-Xin
>>
>
>
--
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel