Bug 1223265 - Fix -Wunreachable-code and -Wimplicit-fallthrough warnings in dom/bindings and dom/ipc. r=khuey

This commit is contained in:
Chris Peterson 2015-11-08 21:41:40 -08:00
Родитель 7bb5f5b8dc
Коммит 155af957a6
2 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -4409,11 +4409,13 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
templateBody = "${declName} = &${val}.toObject();\n"
# For JS-implemented APIs, we refuse to allow passing objects that the
# API consumer does not subsume.
# API consumer does not subsume. The extra parens around
# ($${passedToJSImpl}) suppress unreachable code warnings when
# $${passedToJSImpl} is the literal `false`.
if not isinstance(descriptorProvider, Descriptor) or descriptorProvider.interface.isJSImplemented():
templateBody = fill(
"""
if ($${passedToJSImpl} && !CallerSubsumes($${val})) {
if (($${passedToJSImpl}) && !CallerSubsumes($${val})) {
ThrowErrorMessage(cx, MSG_PERMISSION_DENIED_TO_PASS_ARG, "${sourceDescription}");
$*{exceptionCode}
}
@ -5456,11 +5458,13 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
templateBody = "${declName} = ${val};\n"
# For JS-implemented APIs, we refuse to allow passing objects that the
# API consumer does not subsume.
# API consumer does not subsume. The extra parens around
# ($${passedToJSImpl}) suppress unreachable code warnings when
# $${passedToJSImpl} is the literal `false`.
if not isinstance(descriptorProvider, Descriptor) or descriptorProvider.interface.isJSImplemented():
templateBody = fill(
"""
if ($${passedToJSImpl} && !CallerSubsumes($${val})) {
if (($${passedToJSImpl}) && !CallerSubsumes($${val})) {
ThrowErrorMessage(cx, MSG_PERMISSION_DENIED_TO_PASS_ARG, "${sourceDescription}");
$*{exceptionCode}
}
@ -7319,7 +7323,7 @@ class CGCase(CGList):
self.append(CGGeneric("case " + expression + ": {\n"))
bodyList = CGList([body])
if fallThrough:
bodyList.append(CGGeneric("/* Fall through */\n"))
bodyList.append(CGGeneric("MOZ_FALLTHROUGH;\n"))
else:
bodyList.append(CGGeneric("break;\n"))
self.append(CGIndenter(bodyList))

Просмотреть файл

@ -2177,8 +2177,7 @@ ContentChild::ActorDestroy(ActorDestroyReason why)
// going through the full XPCOM shutdown path, because it doesn't
// keep persistent state.
QuickExit();
#endif
#else
if (sFirstIdleTask) {
sFirstIdleTask->Cancel();
}
@ -2203,6 +2202,7 @@ ContentChild::ActorDestroy(ActorDestroyReason why)
#endif
XRE_ShutdownChildProcess();
#endif // NS_FREE_PERMANENT_DATA
}
void