mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 844996 - DeallocShmem failures will abort in debug builds. r=cjones,benjamin
This commit is contained in:
parent
cb51c6f934
commit
82b2b0484d
@ -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)
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user