]> granicus.if.org Git - libvpx/commitdiff
Fix the win32 crash when GET_GOT is not defined
authorYunqing Wang <yunqingwang@google.com>
Thu, 10 Dec 2015 22:25:01 +0000 (14:25 -0800)
committerYunqing Wang <yunqingwang@google.com>
Thu, 10 Dec 2015 22:25:01 +0000 (14:25 -0800)
This patch continues to fix the win32 crash issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1105

Johann's patch is here:
https://chromium-review.googlesource.com/#/c/316446/2

Change-Id: I7fe191c717e40df8602e229371321efb0d689375

third_party/x86inc/x86inc.asm
vpx_dsp/x86/highbd_subpel_variance_impl_sse2.asm
vpx_dsp/x86/subpel_variance_sse2.asm

index be59de3116745f54d77e839e8240efba29da8a80..e4cda88ef21606239dc1f8eb0c61f75242fbda3f 100644 (file)
 %if ABI_IS_32BIT
     %if CONFIG_PIC=1
         %ifidn __OUTPUT_FORMAT__,elf32
+            %define GET_GOT_DEFINED 1
             %define GET_GOT_SAVE_ARG 1
             %define WRT_PLT wrt ..plt
             %macro GET_GOT 1
                 %define RESTORE_GOT pop %1
             %endmacro
         %elifidn __OUTPUT_FORMAT__,macho32
+            %define GET_GOT_DEFINED 1
             %define GET_GOT_SAVE_ARG 1
             %macro GET_GOT 1
                 push %1
                 %undef RESTORE_GOT
                 %define RESTORE_GOT pop %1
             %endmacro
+        %else
+            %define GET_GOT_DEFINED 0
         %endif
     %endif
 
index 5f9c963d4389d76d8282facbddaa600c08c0d4c4..22d52a2afe0d53b3c0df8f37f0b7265a873a8ddd 100644 (file)
@@ -123,7 +123,10 @@ SECTION .text
       %define sec_str sec_stridemp
 
       ; Store bilin_filter and pw_8 location in stack
-      GET_GOT eax
+      %if GET_GOT_DEFINED == 1
+        GET_GOT eax
+        add esp, 4                ; restore esp
+      %endif
 
       lea ecx, [GLOBAL(bilin_filter_m)]
       mov g_bilin_filterm, ecx
@@ -131,7 +134,6 @@ SECTION .text
       lea ecx, [GLOBAL(pw_8)]
       mov g_pw_8m, ecx
 
-      RESTORE_GOT               ; restore esp
       LOAD_IF_USED 0, 1         ; load eax, ecx back
     %else
       cglobal highbd_sub_pixel_variance%1xh, 7, 7, 13, src, src_stride, \
@@ -140,7 +142,10 @@ SECTION .text
       %define block_height heightd
 
       ; Store bilin_filter and pw_8 location in stack
-      GET_GOT eax
+      %if GET_GOT_DEFINED == 1
+        GET_GOT eax
+        add esp, 4                ; restore esp
+      %endif
 
       lea ecx, [GLOBAL(bilin_filter_m)]
       mov g_bilin_filterm, ecx
@@ -148,7 +153,6 @@ SECTION .text
       lea ecx, [GLOBAL(pw_8)]
       mov g_pw_8m, ecx
 
-      RESTORE_GOT               ; restore esp
       LOAD_IF_USED 0, 1         ; load eax, ecx back
     %endif
   %else
index 1176a2f4cb1aec5379056b86cb4dd4f0e28eecd0..c655e4b346923465dedac786376d504ebd7ed023 100644 (file)
@@ -139,7 +139,10 @@ SECTION .text
       %define sec_str sec_stridemp
 
       ;Store bilin_filter and pw_8 location in stack
-      GET_GOT eax
+      %if GET_GOT_DEFINED == 1
+        GET_GOT eax
+        add esp, 4                ; restore esp
+      %endif
 
       lea ecx, [GLOBAL(bilin_filter_m)]
       mov g_bilin_filterm, ecx
@@ -147,7 +150,6 @@ SECTION .text
       lea ecx, [GLOBAL(pw_8)]
       mov g_pw_8m, ecx
 
-      RESTORE_GOT               ; restore esp
       LOAD_IF_USED 0, 1         ; load eax, ecx back
     %else
       cglobal sub_pixel_variance%1xh, 7, 7, 13, src, src_stride, x_offset, \
@@ -156,7 +158,10 @@ SECTION .text
       %define block_height heightd
 
       ;Store bilin_filter and pw_8 location in stack
-      GET_GOT eax
+      %if GET_GOT_DEFINED == 1
+        GET_GOT eax
+        add esp, 4                ; restore esp
+      %endif
 
       lea ecx, [GLOBAL(bilin_filter_m)]
       mov g_bilin_filterm, ecx
@@ -164,7 +169,6 @@ SECTION .text
       lea ecx, [GLOBAL(pw_8)]
       mov g_pw_8m, ecx
 
-      RESTORE_GOT               ; restore esp
       LOAD_IF_USED 0, 1         ; load eax, ecx back
     %endif
   %else