Bug 1038523 - Make IPDL generate nullptr for ExprLiteral.NULL. r=bent
authorAndrew McCreight <continuation@gmail.com>
Tue, 15 Jul 2014 12:46:52 -0700
changeset 216159 a7e4c299eefee96bc16b25c94e8bc3189eeeac5a
parent 216158 39ee921a5b2f66fec3dfc260274650e2a79db287
child 216160 6c7bd77200db409f2acb81feb156ea5a630ea414
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1038523
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1038523 - Make IPDL generate nullptr for ExprLiteral.NULL. r=bent
ipc/ipdl/ipdl/cxx/ast.py
ipc/ipdl/ipdl/lower.py
--- a/ipc/ipdl/ipdl/cxx/ast.py
+++ b/ipc/ipdl/ipdl/cxx/ast.py
@@ -572,17 +572,17 @@ class ExprLiteral(Node):
 
     @staticmethod
     def WString(s):  return ExprLiteral('L"'+ s +'"', 's')
 
     def __str__(self):
         return ('%'+ self.type)% (self.value)
 ExprLiteral.ZERO = ExprLiteral.Int(0)
 ExprLiteral.ONE = ExprLiteral.Int(1)
-ExprLiteral.NULL = ExprLiteral.ZERO
+ExprLiteral.NULL = ExprVar('nullptr')
 ExprLiteral.TRUE = ExprVar('true')
 ExprLiteral.FALSE = ExprVar('false')
 
 class ExprPrefixUnop(Node):
     def __init__(self, expr, op):
         assert not isinstance(expr, tuple)
         self.expr = expr
         self.op = op
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -3341,17 +3341,17 @@ class _GenerateProtocolActorCode(ipdl.as
         fatalerror = MethodDefn(MethodDecl(
             'FatalError',
             params=[ Decl(Type('char', const=1, ptrconst=1), msgparam.name) ],
             const=1, never_inline=1))
         if self.side is 'parent':
             otherprocess = p.callOtherProcess()
             isparent = ExprLiteral.TRUE
         else:
-            otherprocess = ExprLiteral.NULL
+            otherprocess = ExprLiteral.ZERO
             isparent = ExprLiteral.FALSE
         fatalerror.addstmts([
             _ipcFatalError(actorname, msgparam, otherprocess, isparent)
         ])
         self.cls.addstmts([ fatalerror, Whitespace.NL ])
 
         ## DestroySubtree(bool normal)
         whyvar = ExprVar('why')