On Thu, Jan 31, 2013 at 12:19 PM, grischka <[email protected]> wrote:

>
>
>  -            h = elf_hash(name) % nbuckets;
>> +            h = name ? elf_hash(name) % nbuckets : 0;
>>
>
> This is counterproductive IMO because when you read this you get
> the wrong impression that there are cases where "name" is NULL.
> But in fact there is no such case.  So the naive reader is misled,
> while the knowledgeable reader must conclude that the writer didn't
> know what s/he was doing.


I totally agree with you !
But look some lines above on this same function !!!!!

/* return the symbol number */
ST_FUNC int put_elf_sym(Section *s, uplong value, unsigned long size,
    int info, int other, int shndx, const char *name)
{
    int name_offset, sym_index;
    int nbuckets, h;
    ElfW(Sym) *sym;
    Section *hs;

    sym = section_ptr_add(s, sizeof(ElfW(Sym)));
    if (name)
/////////////////////////////////////////////////////////////<<<< This mean
name can be null ?????????
        name_offset = put_elf_str(s->link, name);
    else
        name_offset = 0;
    /* XXX: endianness */
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to