Bug 848237 - Let IPDL generate runtime aborts for constructor failures in child processes. r=bsmedberg

This commit is contained in:
Georg Fritzsche 2013-04-15 15:57:14 +02:00
parent 84fac888de
commit 56f4a528de

View File

@ -4653,9 +4653,15 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
actorvar = md.actorDecl().var()
type = md.decl.type.constructedType()
failif = StmtIf(cond)
failif.addifstmts(self.destroyActor(md, actorvar,
why=_DestroyReason.FailedConstructor)
+ [ StmtReturn(ExprLiteral.NULL) ])
if self.side=='child':
# in the child process this should not fail
failif.addifstmt(_runtimeAbort('constructor for actor failed'))
else:
failif.addifstmts(self.destroyActor(md, actorvar,
why=_DestroyReason.FailedConstructor))
failif.addifstmt(StmtReturn(ExprLiteral.NULL))
return [ failif ]
def genHelperCtor(self, md):