Академический Документы
Профессиональный Документы
Культура Документы
Проверка проекта Dolphin-emu
Проверка проекта Dolphin-emu
:
: 24.02.2012
PVSStudio. - , .
Dolphin-emu.
. ,
. ,
.
, Dolphin-emu :
bool IRBuilder::maskedValueIsZero(
InstLoc Op1, InstLoc Op2) const
{
return (~ComputeKnownZeroBits(Op1) &
~ComputeKnownZeroBits(Op1)) == 0;
}
PVS-Studio:
V501 There are identical sub-expressions '~ComputeKnownZeroBits(Op1)' to the left and to the right of
the '&' operator. Core ir.cpp 1215
- 'Op1' 'Op2'.
, ')'.
memset()
memcpy().
u32 Flatten(..., BlockStats *st, ...)
{
...
memset(st, 0, sizeof(st));
...
}
PVS-Studio:
V579 The memset function receives the pointer and its size as arguments. It is possibly a mistake.
Inspect the third argument. Core ppcanalyst.cpp 302
, BlockStats.
: sizeof(*st).
:
void drawShadedTexSubQuad(...,
const MathUtil::Rectangle<float>* rDest, ...)
{
...
if (stsq_observer ||
memcmp(rDest,
&tex_sub_quad_data.rdest, sizeof(rDest)) != 0 ||
tex_sub_quad_data.u1 != u1 ||
tex_sub_quad_data.v1 != v1 ||
tex_sub_quad_data.u2 != u2 ||
tex_sub_quad_data.v2 != v2 ||
tex_sub_quad_data.G != G)
...
}
. : sizeof(*rDest).
float
Dolphin-emu, float,
. float == !=.
.
float V550.
:
float Slope::GetValue(float dx, float dy)
{
return f0 + (dfdx * dx) + (dfdy * dy);
void CMemoryWindow::onSearch(wxCommandEvent& event)
{
...
//sprintf(tmpstr, "%s%s", tmpstr, rawData.c_str());
//strcpy(&tmpstr[1], rawData.ToAscii());
//memcpy(&tmpstr[1], &rawData.c_str()[0], rawData.size());
sprintf(tmpstr, "%s%s", tmpstr, (const char *)rawData.mb_str());
...
}
, .
. , . PVS-Studio
:
V541 It is dangerous to print the string 'tmpstr' into itself. Dolphin memorywindow.cpp 344
, "tmpstr" .
, . sprintf()
. ,
strcat().
, , :
V541 It is dangerous to print the string 'pathData_bin' into itself. Dolphin wiisavecrypted.cpp 513
V541 It is dangerous to print the string 'regs' into itself. Core interpreter.cpp 84
V541 It is dangerous to print the string 'fregs' into itself. Core interpreter.cpp 89
, PVS-Studio.
.