MOZ_CAN_RUN_SCRIPT may require unnecessary refcount if a method returns pointer to itself as different type
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement, P4)
Tracking
(Not tracked)
People
(Reporter: masayuki, Unassigned)
References
(Blocks 1 open bug)
Details
Reporter | ||
Comment 1•6 years ago
|
||
If we won't add a template class like already_AddRefed
, using MOZ_KnownLive()
in each caller is the solution.
What do you think, bz?
Comment 2•6 years ago
|
||
We can use MOZ_KnownLive for now, yes, but it would be better if this were handled automatically somehow. The problem is that automatic handling would need to catch cases like this:
auto* bar = foo->AsBar();
foo = baz;
bar->DoSomethingDangerous();
with the "foo = baz" possibly hidden inside other function calls, etc.
I don't have any bright ideas for automating this so far.
Updated•4 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 3•1 year ago
|
||
After bug 1843484, there will not be any comments left pointing to this bug. The issue described in comment 0 will still remain, though; but we may not have any code any more which runs into it.
Comment 4•1 year ago
|
||
Nevermind - bug 1843484 adds things like EventDispatcher::DispatchDOMEvent(MOZ_KnownLive(nsGlobalWindowInner::Cast(win)), ...)
which will point to this bug after all.
Description
•