Closed Bug 16763 Opened 26 years ago Closed 17 years ago

CreateInstance implementation does not check for aggregation

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

RESOLVED INCOMPLETE
Future

People

(Reporter: hjtoi-bugzilla, Unassigned)

Details

Attachments

(1 file)

Many implementations of CreateInstance do not check the value of the [in] parameter (typically 'aOuter') that tells if aggregation is to be used. Most implementations are not aggregations so they should check it and report NS_ERROR_NO_AGGREGATION if appropriate.
Status: NEW → ASSIGNED
Target Milestone: M16
Yeah I have seen some of this too.
I must be really bored... I decided to flex my Perl muscle(s?) a bit to find where this bug occurs. But not so bored that I would have made the script perfect. I guess jst & julle @citec.fi are as bored as I am and we spent a considerable amount of time figuring out how to run this script, heh. Finally when all else was set and I started it on NT with the bash shell it went fine for some time and then got access violation. So I asked jst to run the same thing on Linux so eventually we got some output ;) Anyway, the script is below and I will attach the script output. --ht.pl-- #!perl # # Utitility to find CreateInstance implementations that do not # return NS_ERROR_NO_AGGREGATION. See Bugzilla bug #16763. # # Invocation (from MOZ_TOP directory) (bash): # for i in `find . -name '*.h' -or -name '*.cpp'`; do ht.pl $i; done # $file = $ARGV[0]; $in = 0; $line = 0; $brace = 0; $in_method = 0; $create_line = ""; # If true, output is in HTML (need html, head, body tags) $html = 1; # LXR base $lxr = "http://lxr.mozilla.org/seamonkey/source/"; if ($html) { print "<ul>\n"; } while (<>) { $line++; if (/Factory::CreateInstance/) { if ($html) { $create_line = "<li><a href=\"$lxr$file#$line\">$file:$line:</a> $_</li>"; } else { $create_line = "$file:$line: $_"; } $in = 1; } if ($in) { if (/\{/) { if ($brace++ == 0) { $in_method = 1; } } if (/\}/) { $brace--; } if ($brace < 0) { if ($html) { print "</ul><p><b>Misplaced braces?</b></p>\n"; } else { print "Misplaced braces?\n"; } exit; } if ($in_method and $brace == 0) { $in = 0; $in_method = 0; print "$create_line"; } if ($in_method and /NS_ERROR_NO_AGGREGATION/) { $brace = 0; $in = 0; $in_method = 0; } } } if ($html) { print "</ul>\n"; }
Assignee: dp → scc
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Note: this is another good thing to check for with the [XP]COM lint script.
Target Milestone: M16 → M20
mass re-assigning to my new bugzilla account
Assignee: scc → scc
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
dp is no longer @netscape.com. changing qa contact to default for this product
QA Contact: dp → kandrot
re-assigning to XPCOM owner
Assignee: scc → dougt
Status: ASSIGNED → NEW
QA Contact: kandrot → scc
Target Milestone: --- → Future
Assignee: dougt → nobody
QA Contact: scc → xpcom
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: