ref: 68b4b09ae6e39c115107aac819384f3a5568d9b4
parent: d8e78fee09c4fcb31cf126f41fec10fa42abfe98
author: Martin Storsjö <[email protected]>
date: Fri Jun 27 15:26:17 EDT 2014
Don't load undefined bits into rcx before calling the cpuid instruction The pFeatureC pointer is an uint32_t pointer, therefore only load 32 bits into ecx. This avoids loading potentially uninitialized data into the upper half of the rcx register, fixing valgrind warnings in some build setups (depending on how the compiler chooses to layout the stack in the calling function).
--- a/codec/common/x86/cpuid.asm
+++ b/codec/common/x86/cpuid.asm
@@ -81,7 +81,7 @@
push rdx
mov eax, ecx
- mov rcx, [r9]
+ mov ecx, [r9]
cpuid
mov [r9], ecx
mov [r8], ebx
@@ -100,7 +100,7 @@
push rdx
mov eax, edi
- mov rcx, [rcx]
+ mov ecx, [rcx]
cpuid
mov [r8], edx
pop rdx