Bug 1550560 - Part 4: Don't generate helper ctors for refcounted actors, r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D39535

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2019-07-29 19:54:20 +00:00
Родитель 2698092f32
Коммит efac1124a9
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -3946,7 +3946,16 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
if self.sendsMessage(md):
isasync = decltype.isAsync()
if isctor:
# NOTE: Don't generate helper ctors for refcounted types.
#
# Safety concerns around providing your own actor to a ctor (namely
# that the return value won't be checked, and the argument will be
# `delete`-ed) are less critical with refcounted actors, due to the
# actor being held alive by the callsite.
#
# This allows refcounted actors to not implement crashing AllocPFoo
# methods on the sending side.
if isctor and not md.decl.type.constructedType().isRefcounted():
self.cls.addstmts([self.genHelperCtor(md), Whitespace.NL])
if isctor and isasync: