Bug 716859 - Avoid jump crossing variable declaration (GCC bustage fix)
authorJacek Caban <jacek@codeweavers.com>
Tue, 26 Feb 2013 12:06:43 +0100
changeset 123011 b00914c9e7d4
parent 123010 a936abbcf23f
child 123012 9198ac37724b
push id24372
push useremorley@mozilla.com
push dateWed, 27 Feb 2013 13:22:59 +0000
treeherdermozilla-central@0a91da5f5eab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs716859
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 716859 - Avoid jump crossing variable declaration (GCC bustage fix)
gfx/gl/SharedSurfaceANGLE.cpp
--- a/gfx/gl/SharedSurfaceANGLE.cpp
+++ b/gfx/gl/SharedSurfaceANGLE.cpp
@@ -211,31 +211,32 @@ SharedSurface_ANGLEShareHandle::Create(G
     // Declare everything before 'goto's.
     HANDLE shareHandle = nullptr;
     nsRefPtr<ID3D10Texture2D> texture;
     nsRefPtr<ID3D10ShaderResourceView> srv;
 
     // On failure, goto CleanUpIfFailed.
     // If |failed|, CleanUpIfFailed will clean up and return null.
     bool failed = true;
+    HRESULT hr;
 
     // Off to the races!
     if (!egl->fQuerySurfacePointerANGLE(
             display,
             pbuffer,
             LOCAL_EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE,
             &shareHandle))
     {
         NS_ERROR("Failed to grab ShareHandle for PBuffer!");
         goto CleanUpIfFailed;
     }
 
     // Ok, we have a valid PBuffer with ShareHandle.
     // Let's attach it to D3D.
-    HRESULT hr = d3d->OpenSharedResource(shareHandle,
+    hr = d3d->OpenSharedResource(shareHandle,
                                          __uuidof(ID3D10Texture2D),
                                          getter_AddRefs(texture));
     if (FAILED(hr))
         goto CleanUpIfFailed;
 
     hr = d3d->CreateShaderResourceView(texture, nullptr, getter_AddRefs(srv));
     if (FAILED(hr))
         goto CleanUpIfFailed;