mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 13:39:46 +00:00
x86: fix a race condition made by a static variable initialization. bug reported by Xiaozhu Meng
This commit is contained in:
parent
c602427ca3
commit
30bffad2d4
@ -159,11 +159,8 @@ static InstrUID decode(OpcodeType type,
|
||||
uint8_t modRM)
|
||||
{
|
||||
const struct ModRMDecision *dec = NULL;
|
||||
static unsigned int index = -1;
|
||||
static struct OpcodeDecision emptyDecision;
|
||||
|
||||
if (index == -1)
|
||||
memset((void *)&emptyDecision, 0, sizeof(emptyDecision));
|
||||
unsigned int index;
|
||||
static struct OpcodeDecision emptyDecision = { 0 };
|
||||
|
||||
switch (type) {
|
||||
default: break; // never reach
|
||||
|
Loading…
Reference in New Issue
Block a user