Vehicle for minor bugs?

Jacek Caban jacek at codeweavers.com
Mon May 5 17:47:49 CDT 2008


Hi Andrew,

Andrew Talbot wrote:
> Often this is so. But some bugs may not be revealed by such a test. Also,
> sometimes it would be useful to ask an expert what was intended by a bit of
> code. For example, consider the following code (from
> mshtml/mshtmloption.c), to pick something at random:
>
> static HRESULT WINAPI HTMLOptionElementFactory_create(...)
> {
>     ...
>     HRESULT hres;
>
>     ...
>
>     hres = IHTMLDOMNode_QueryInterface(...);
>
>     '''
>
>     return S_OK;
> }
>
> In this function, either "hres" is an unused variable, or the function
> should really return "hres" at the end. I have no way of knowing, but I
> would like to be able to bring this to the attention of the mshtml guys so
> they can make a judgment from their knowledge of what this function is
> about.
>   

IHTMLDOMNode_QueryInterface should never fail here. If it fails, there is something seriously wrong going on. But, anyway, to handle the failure correctly, we could add check hres after releasing nselem like:

if(FAILED(hres))
    return hres;


Jacek




More information about the wine-devel mailing list