This patch looks fine to me. Please commit it.

在 2011年1月20日 下午1:30,朱庆 <zqing1...@gmail.com>写道:

> Hi all,
>
> Can gatekeeper help review this fix?
>
> https://bugs.open64.net/show_bug.cgi?id=703
>
>
>
> The error is caused by fixing bug580, the fix assume the ST’s  initial size
> always larger than ST size, but there is an counterexampler:
>
>
>
> case:
>
> struct foo {
>
> public:
>
>   virtual int bar(int);
>
> };
>
>
>
> void (foo::*__Virtual__foo__Var1)() = (void (foo::*)())(&foo::bar);
>
>
>
> here the symbol __Virtual__foo__Var1's initial is
>
> INITOs:
>
> [1]: .init (0x3301):
>
> BLOCK:
>
> VAL: 1
>
> VAL: 0
>
> ENDBLOCK
>
> [2]: __Virtual__foo__Var1 (0x3201):
>
> SYMOFF: .init(0x3301)+0(0x0)
>
>
>
> It is an symoff kind, from the code, for symoff kind the into_size is
>
> equal to pointer size, but not .init(0x3301)'s size.
>
>
>
> So my fix is to add some constraint on the assertion
>
>
>
> Index: osprey/be/com/data_layout.cxx
>
> ===================================================================
>
> --- osprey/be/com/data_layout.cxx       (revision 3462)
>
> +++ osprey/be/com/data_layout.cxx       (working copy)
>
> @@ -652,7 +652,7 @@
>
>    INT64 size;
>
>    INITO_IDX ino_idx;
>
>    // if blk is variable length struct, its size should be inito size.
>
> -  if (TY_kind(ST_type(blk)) == KIND_STRUCT && (ino_idx =
> Find_INITO_For_Symbol(blk)) != 0)
>
> +  if (TY_kind(ST_type(blk)) == KIND_STRUCT && (ino_idx =
> Find_INITO_For_Symbol(blk)) != 0 && INITV_kind(INITO_val(ino_idx)) ==
> INITVKIND_BLOCK)
>
>    {
>
>      size = Get_INITO_Size(ino_idx);
>
>      Is_True(size >= ST_size(blk),("%s's inito size smaller than
> ST_size",ST_name(blk)));
>
>
>
> Thanks
>
> Zhuqing
>
>
>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand
> malware threats, the impact they can have on your business, and how you
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>


-- 
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to