Skip to content

Commit

Permalink
Only call ND_SIGN_EX when instruction has displacement
Browse files Browse the repository at this point in the history
  • Loading branch information
turol committed Aug 28, 2024
1 parent c611c8a commit a2d3f7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bddisasm/bdx86_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ NdParseMemoryOperand16(
// Store the displacement.
Operand->Info.Memory.HasDisp = !!Instrux->HasDisp;
Operand->Info.Memory.DispSize = Instrux->DispLength;
Operand->Info.Memory.Disp = ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement);
Operand->Info.Memory.Disp = Instrux->HasDisp ? ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement) : 0;

return ND_STATUS_SUCCESS;
}
Expand Down Expand Up @@ -1416,7 +1416,7 @@ NdParseMemoryOperand3264(

Operand->Info.Memory.HasDisp = Instrux->HasDisp;
Operand->Info.Memory.DispSize = Instrux->DispLength;
Operand->Info.Memory.Disp = ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement);
Operand->Info.Memory.Disp = Instrux->HasDisp ? ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement) : 0;

return ND_STATUS_SUCCESS;
}
Expand Down

0 comments on commit a2d3f7d

Please sign in to comment.