зеркало из https://github.com/mozilla/gecko-dev.git
Bug 844996 - DeallocShmem failures will abort in debug builds. r=cjones,benjamin
This commit is contained in:
Родитель
e8aa91a4a3
Коммит
2e9c45b7dc
|
@ -3851,6 +3851,11 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
|||
|
||||
# bool DeallocShmem(Shmem& mem):
|
||||
# bool ok = DestroySharedMemory(mem);
|
||||
##ifdef DEBUG
|
||||
# if (!ok) {
|
||||
# NS_RUNTIMEABORT("bad Shmem");
|
||||
# }
|
||||
##endif // DEBUG
|
||||
# mem.forget();
|
||||
# return ok;
|
||||
deallocShmem = MethodDefn(MethodDecl(
|
||||
|
@ -3859,10 +3864,16 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
|||
ret=Type.BOOL))
|
||||
okvar = ExprVar('ok')
|
||||
|
||||
ifbad = StmtIf(ExprNot(okvar))
|
||||
ifbad.addifstmt(_runtimeAbort('bad Shmem'))
|
||||
|
||||
deallocShmem.addstmts([
|
||||
StmtDecl(Decl(Type.BOOL, okvar.name),
|
||||
init=ExprCall(p.destroySharedMemory(),
|
||||
args=[ memvar ])),
|
||||
CppDirective('ifdef', 'DEBUG'),
|
||||
ifbad,
|
||||
CppDirective('endif', '// DEBUG'),
|
||||
StmtExpr(_shmemForget(memvar)),
|
||||
StmtReturn(okvar)
|
||||
])
|
||||
|
|
Загрузка…
Ссылка в новой задаче