Last Comment Bug 466736 - Incorrect use of NSS_USE_64 in lib/libpkix/pkix_pl_nss/system/pkix_pl_object.c
: Incorrect use of NSS_USE_64 in lib/libpkix/pkix_pl_nss/system/pkix_pl_object.c
Status: RESOLVED FIXED
:
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: unspecified
: All All
: -- trivial (vote)
: 3.12.3
Assigned To: Alexei Volkov
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-25 15:38 PST by Wan-Teh Chang
Modified: 2008-11-27 07:09 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Remove the #ifdef NSS_USE_64 code (1.19 KB, patch)
2008-11-25 15:38 PST, Wan-Teh Chang
alvolkov.bgs: review+
Details | Diff | Splinter Review

Description Wan-Teh Chang 2008-11-25 15:38:08 PST
Created attachment 350072 [details] [diff] [review]
Remove the #ifdef NSS_USE_64 code

As this MXR query shows:
http://mxr.mozilla.org/security/search?string=NSS_USE_64

the NSS_USE_64 macro is only defined by lib/freebl/Makefile.
So the #ifdef NSS_USE_64 tests in
lib/libpkix/pkix_pl_nss/system/pkix_pl_object.c are guaranteed
to be false.

They should be either replaced by #ifdef IS_64 tests, or
removed (the code inside those #ifdef NSS_USE_64 tests is
dead code).  The relevant code is reproduced below:

398 static PKIX_Error *
399 pkix_pl_Object_Hashcode_Default(
400         PKIX_PL_Object *object,
401         PKIX_UInt32 *pValue,
402         void *plContext)
403 {
404 #ifdef NSS_USE_64
405         union {
406                 void *pointer;
407                 PKIX_UInt32 hilo[2];
408         } extracter;
409 #endif
410 
411         PKIX_ENTER(OBJECT, "pkix_pl_Object_Hashcode_Default");
412         PKIX_NULLCHECK_TWO(object, pValue);
413 
414 #ifdef NSS_USE_64
415         extracter.pointer = object;
416         *pValue = extracter.hilo[1];
417 #else
418         *pValue = (PKIX_UInt32)object;
419 #endif
420 
421         PKIX_RETURN(OBJECT);
422 }
Comment 1 Alexei Volkov 2008-11-26 09:54:07 PST
Comment on attachment 350072 [details] [diff] [review]
Remove the #ifdef NSS_USE_64 code

r+.
Comment 2 Wan-Teh Chang 2008-11-27 07:09:42 PST
I checked in the patch on the NSS trunk (NSS 3.12.3).

Checking in pkix_pl_object.c;
/cvsroot/mozilla/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_object.c,v
 <--  pkix_pl_object.c
new revision: 1.11; previous revision: 1.10
done

Note You need to log in before you can comment on or make changes to this bug.