This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: Crash in tc-m68k.c:md_estimate_size_before_relax()


Hi Jason,

> I've encountered a bug in gas 2.11.93 20011223 that manifests itself
> as a crash in tc-m68k.c:md_estimate_size_before_relax() in the byte
> branch checks (which you touched on 2001-07-03).
> 
> The code in question:
>     
>           sym_frag = symbol_get_frag (fragP->fr_symbol);
>           if (S_GET_VALUE (fragP->fr_symbol) == sym_frag->fr_address)
>             {
>               fragS *l;
>             
>               for (l = fragP->fr_next; l != sym_frag; l = l->fr_next)
>                 if (l->fr_fix != 0)
>                     ^^^^^^^^^
>                     NULL-pointer deref here
>                   break;
>               if (l == sym_frag)
>                 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);

I added a test for the NULL pointer and now your test case assembles
without dumping core.

Cheers
        Nick


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