X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libctf%2Fctf-lookup.c;fp=libctf%2Fctf-lookup.c;h=6f180d68c2eb602248f26942c91b15347e29ebd1;hb=676c3ecbad6e9c41b906b0f882ef2ce23f49976a;hp=40eaf9c819dcadcb36ab4570a646c3e81836d289;hpb=791915db4273edbfb1952897cbf4c9745101c0e4;p=deliverable%2Fbinutils-gdb.git diff --git a/libctf/ctf-lookup.c b/libctf/ctf-lookup.c index 40eaf9c819..6f180d68c2 100644 --- a/libctf/ctf-lookup.c +++ b/libctf/ctf-lookup.c @@ -161,8 +161,8 @@ ctf_lookup_by_name (ctf_file_t *fp, const char *name) } } - if ((type = ctf_hash_lookup_type (lp->ctl_hash, fp, - fp->ctf_tmp_typeslice)) == 0) + if ((type = ctf_lookup_by_rawhash (fp, lp->ctl_hash, + fp->ctf_tmp_typeslice)) == 0) { (void) ctf_set_errno (fp, ECTF_NOTYPE); goto err; @@ -322,13 +322,6 @@ ctf_lookup_by_id (ctf_file_t **fpp, ctf_id_t type) return NULL; } - idx = LCTF_TYPE_TO_INDEX (fp, type); - if (idx > 0 && (unsigned long) idx <= fp->ctf_typemax) - { - *fpp = fp; /* Function returns ending CTF container. */ - return (LCTF_INDEX_TO_TYPEPTR (fp, idx)); - } - /* If this container is writable, check for a dynamic type. */ if (fp->ctf_flags & LCTF_RDWR) @@ -340,7 +333,19 @@ ctf_lookup_by_id (ctf_file_t **fpp, ctf_id_t type) *fpp = fp; return &dtd->dtd_data; } + (void) ctf_set_errno (*fpp, ECTF_BADID); + return NULL; } + + /* Check for a type in the static portion. */ + + idx = LCTF_TYPE_TO_INDEX (fp, type); + if (idx > 0 && (unsigned long) idx <= fp->ctf_typemax) + { + *fpp = fp; /* Function returns ending CTF container. */ + return (LCTF_INDEX_TO_TYPEPTR (fp, idx)); + } + (void) ctf_set_errno (*fpp, ECTF_BADID); return NULL; }