Last Comment Bug 672583 - MacLaunchHandler.cc incorrectly uses NS_ARRAY_LENGTH on a pointer
: MacLaunchHandler.cc incorrectly uses NS_ARRAY_LENGTH on a pointer
Status: RESOLVED FIXED
:
Product: Core Graveyard
Classification: Graveyard
Component: Embedding: Mac (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla8
Assigned To: Josh Matthews [:jdm] (on vacation until Dec 5)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-19 11:32 PDT by Josh Matthews [:jdm] (on vacation until Dec 5)
Modified: 2016-06-23 14:32 PDT (History)
2 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Avoid calling NS_ARRAY_LENGTH on a pointer. (1.51 KB, patch)
2011-07-19 11:39 PDT, Josh Matthews [:jdm] (on vacation until Dec 5)
jaas: review+
Details | Diff | Splinter Review

Description Josh Matthews [:jdm] (on vacation until Dec 5) 2011-07-19 11:32:44 PDT
>87   cpu_type_t *wanted_type = pref_cpu_types;
>88 
>89   if (aRestartType & nsIAppStartup::eRestarti386)
>90     wanted_type = cpu_i386_types;
>91   else if (aRestartType & nsIAppStartup::eRestartx86_64)
>92     wanted_type = cpu_x64_86_types;
>93 
>94   // Set spawn attributes.
>95   size_t attr_count = NS_ARRAY_LENGTH(wanted_type);
Comment 1 Josh Matthews [:jdm] (on vacation until Dec 5) 2011-07-19 11:39:24 PDT
Created attachment 546844 [details] [diff] [review]
Avoid calling NS_ARRAY_LENGTH on a pointer.
Comment 2 Josh Matthews [:jdm] (on vacation until Dec 5) 2011-07-21 12:53:23 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/ca526e2c233a
Comment 3 Robert O'Callahan (:roc) (email my personal email if necessary) 2011-07-21 15:51:56 PDT
We should use a template to ensure that NS_ARRAY_LENGTH is only used on an array.
Comment 4 Josh Matthews [:jdm] (on vacation until Dec 5) 2011-07-21 16:02:37 PDT
Coincidentally, I have a patch that does that, which is what found this instance.
Comment 5 Robert O'Callahan (:roc) (email my personal email if necessary) 2011-07-21 16:07:24 PDT
Nice.

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