On Tue, 3 Jul 2012, Jacek Caban wrote: [...]
It would probably be more appropriate to add assert(SUCCEEDED(hres)); after IsClassOfCategories calls, which can't fail.
Ok. Would something like this be ok? It seems like this single assert() is enough to make gcc happy here.
commit 2c47407d6e11ddb66050890abd5403b302c7d6c6 Author: Francois Gouget fgouget@free.fr Date: Mon Jul 16 10:33:50 2012 +0200
mshtml: Avoid returning with an unset URL policy in error cases.
diff --git a/dlls/mshtml/secmgr.c b/dlls/mshtml/secmgr.c index ff349ac..f961bca 100644 --- a/dlls/mshtml/secmgr.c +++ b/dlls/mshtml/secmgr.c @@ -20,6 +20,7 @@
#include <stdarg.h> #include <stdio.h> +#include <assert.h>
#define COBJMACROS
@@ -104,9 +105,7 @@ static HRESULT confirm_safety_load(HTMLDocumentNode *This, struct CONFIRMSAFETY CATID init_catid = CATID_SafeForInitializing;
hres = ICatInformation_IsClassOfCategories(This->catmgr, &cs->clsid, 1, &init_catid, 0, NULL); - if(FAILED(hres)) - return hres; - + assert(SUCCEEDED(hres)); *ret = hres == S_OK ? URLPOLICY_ALLOW : URLPOLICY_DISALLOW; }