From 56f4a528dee2ac756b1ff99eb5165158c433c317 Mon Sep 17 00:00:00 2001 From: Georg Fritzsche Date: Mon, 15 Apr 2013 15:57:14 +0200 Subject: [PATCH] Bug 848237 - Let IPDL generate runtime aborts for constructor failures in child processes. r=bsmedberg --- ipc/ipdl/ipdl/lower.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ipc/ipdl/ipdl/lower.py b/ipc/ipdl/ipdl/lower.py index 5bf12dc15e5..94136c1fcab 100644 --- a/ipc/ipdl/ipdl/lower.py +++ b/ipc/ipdl/ipdl/lower.py @@ -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):