Bug 1319271 - Return early in Send__delete__ method when Send fails. r=billm
authorKan-Ru Chen <kanru@kanru.info>
Thu, 24 Nov 2016 14:31:02 +0800
changeset 325395 28a55c1ec275c381b2dfd174c8847d8339d7f652
parent 325394 c17cc72764e636b7354463508db84ef6bf01eade
child 325396 a4417f62daa838bfb6cd501ddfaeb9f1e70240e0
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbillm
bugs1319271
milestone53.0a1
Bug 1319271 - Return early in Send__delete__ method when Send fails. r=billm Only for the async version. MozReview-Commit-ID: GOVSpzT3JlX
ipc/ipdl/ipdl/lower.py
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -4145,22 +4145,25 @@ class _GenerateProtocolActorCode(ipdl.as
         actor = md.actorDecl()
         actorvar = actor.var()
         method = MethodDefn(self.makeDtorMethodDecl(md))
 
         method.addstmts(self.dtorPrologue(actorvar))
 
         msgvar, stmts = self.makeMessage(md, errfnSendDtor, actorvar)
         sendok, sendstmts = self.sendAsync(md, msgvar, actorvar)
+        failif = StmtIf(ExprNot(sendok))
+        failif.addifstmt(StmtReturn.FALSE)
+
         method.addstmts(
             stmts
             + self.genVerifyMessage(md.decl.type.verify, md.params,
                                     errfnSendDtor, ExprVar('msg__'))
             + sendstmts
-            + [ Whitespace.NL ]
+            + [ failif, Whitespace.NL ]
             + self.dtorEpilogue(md, actor.var())
             + [ StmtReturn(sendok) ])
 
         lbl = CaseLabel(md.pqReplyId())
         case = StmtBlock()
         case.addstmt(StmtReturn(_Result.Processed))
         # TODO if the dtor is "inherently racy", keep the actor alive
         # until the other side acks