To get a trial key
fill out the form below
Team License (standard version)
Enterprise License (extended version)
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
GBP
RUB
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

** This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
Examples of errors detected by the V570…

Examples of errors detected by the V570 diagnostic

Apr 05 2021

V570. The variable is assigned to itself.


Qt

V570 The 'transition->m_hasGetterSetterProperties' variable is assigned to itself. QtScript structure.cpp 512


PassRefPtr<Structure> Structure::
  getterSetterTransition(Structure* structure)
{
  ....
  RefPtr<Structure> transition =
    create(structure->storedPrototype(), structure->typeInfo());
  transition->m_propertyStorageCapacity =
    structure->m_propertyStorageCapacity;
  transition->m_hasGetterSetterProperties =      // <=
    transition->m_hasGetterSetterProperties;
  transition->m_hasNonEnumerableProperties =
    structure->m_hasNonEnumerableProperties;
  transition->m_specificFunctionThrashCount =
    structure->m_specificFunctionThrashCount;
  ....
}

A critical initialization error: transition->m_hasGetterSetterProperties = transition->m_hasGetterSetterProperties.


ReactOS

V570 The 'mii->cch' variable is assigned to itself. user32 menu.c 4347


BOOL WINAPI GetMenuItemInfoA(....)
{
  ....
  mii->cch = mii->cch;
  ....
}

Looks like a misprint. The code should look like this: mii->cch = miiW->cch;


Quake-III-Arena

V570 The 'p->org[0]' variable is assigned to itself. cgame cg_marks.c 1267


void CG_ParticleSnowFlurry (qhandle_t pshader, centity_t *cent)
{
  ....
  p->org[0] = p->org[0];
  p->org[1] = p->org[1];
  p->org[2] = p->org[2];
  ....
}

OpenCV

V570 The 'stereo.fundMatr[i]' variable is assigned to itself. calibfilter.cpp 339


typedef struct CvStereoCamera
{
 ....
 float fundMatr[9]; /* fundamental matrix */
 ....
};

CvStereoCamera stereo;

void CvCalibFilter::Stop( bool calibrate )
{
  ....
  for( i = 0; i < 9; i++ )
  {
    stereo.fundMatr[i] = stereo.fundMatr[i];
  }
  ....
}

OpenCV

V570 The 'xyD[r]' variable is assigned to itself. test_imgwarp_strict.cpp 560


void CV_Resize_Test::resize_1d(....)
{
  ....
  for (int r = 0; r < cn; ++r)
  {
    xyD[r] = 0;
    for (int k = 0; k < ksize; ++k)
      xyD[r] += w[k] * xyS[k * cn + r];
    xyD[r] = xyD[r];
  }
  ....
}

OpenCV

V570 The 'sizes[INPUT][0].height' variable is assigned to itself. test_math.cpp 1356


void Core_DetTest::get_test_array_types_and_sizes(....)
{
  ....
  sizes[INPUT][0].width =
    sizes[INPUT][0].height = sizes[INPUT][0].height;
  ....
}

ReactOS

V570 The 'pUserColorControl->dwFlags' variable is assigned to itself. gdientry.c 1029


DWORD WINAPI
DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA pData)
{
  ....
  pUserColorControl->dwFlags = pUserColorControl->dwFlags;
  ....
}

Similar errors can be found in some other places:

  • V570 The 'Irp->IoStatus.Information' variable is assigned to itself. hidclass.c 461

VirtualDub

V570 The 'this->hic' variable is assigned to itself. Riza w32videocodecpack.cpp 253


void VDVideoCompressorVCM::Start(const void *inputFormat,
                                 uint32 inputFormatSize,
                                 const void *outputFormat,
                                 uint32 outputFormatSize,
                                 const VDFraction& frameRate,
                                 VDPosition frameCount)
{
  this->hic    = hic;
  ....
}

Coin3D

V570 The 'v0[0]' variable is assigned to itself. sotext3.cpp 1158


void
SoText3P::generate(....)
{
  ....
  v0[0] = v0[0];
  ....
}

Similar errors can be found in some other places:

  • V570 The 'v0[1]' variable is assigned to itself. sotext3.cpp 1159
  • V570 The 'v1[0]' variable is assigned to itself. sotext3.cpp 1160
  • V570 The 'v1[1]' variable is assigned to itself. sotext3.cpp 1161
  • And 4 additional diagnostic messages.

CryEngine 3 SDK

V570 The 'modifiedSlopeNormal.z' variable is assigned to itself. playerstateground.cpp 227


void CPlayerStateGround::OnPrePhysicsUpdate(....)
{
  ....
  modifiedSlopeNormal.z = modifiedSlopeNormal.z;
  ....
}

Unreal Engine 4

V570 The 'ResolveParams.CubeFace' variable is assigned to itself. rhi.h 1279


enum ECubeFace;
ECubeFace CubeFace;

friend FArchive& operator<<(
  FArchive& Ar,FResolveParams& ResolveParams)
{
  ....
  if(Ar.IsLoading())
  {
    ResolveParams.CubeFace = (ECubeFace)ResolveParams.CubeFace;
  }
  ....
}

TortoiseGit

V570 The 'blame->path' variable is assigned to itself. blame.c 319


static int blame_internal(git_blame *blame)
{
  ....
  blame->ent = ent;
  blame->path = blame->path;
  ....
}

Chromium

V570 The 'tmp_rect.right' variable is assigned to itself. text_store.cc 320


STDMETHODIMP TextStore::GetTextExt(....) {
  ....
  tmp_rect.right = tmp_rect.right;
  ....
}

OpenJPEG

V570 The 'p_stream->m_current_data' variable is assigned to itself. cio.c 675


OPJ_SIZE_T opj_stream_write_skip (
  opj_stream_private_t * p_stream, ....)
{
  ....
  if (!l_is_written)
  {
    p_stream->m_status |= opj_stream_e_error;
    p_stream->m_bytes_in_buffer = 0;
    p_stream->m_current_data = p_stream->m_current_data;
    return (OPJ_SIZE_T) -1;
  }
  ....
}

Linux Kernel

V570 The 'acx->window_size' variable is assigned to itself. acx.c 1728


int wl12xx_acx_config_hangover(struct wl1271 *wl)
{
  ....
  acx->recover_time = cpu_to_le32(conf->recover_time);
  acx->hangover_period = conf->hangover_period;
  acx->dynamic_mode = conf->dynamic_mode;
  acx->early_termination_mode = conf->early_termination_mode;
  acx->max_period = conf->max_period;
  acx->min_period = conf->min_period;
  acx->increase_delta = conf->increase_delta;
  acx->decrease_delta = conf->decrease_delta;
  acx->quiet_time = conf->quiet_time;
  acx->increase_time = conf->increase_time;
  acx->window_size = acx->window_size;         // <=
  ....
}

FreeCAD

V570 The 'this->quat[3]' variable is assigned to itself. rotation.cpp 260


Rotation & Rotation::invert(void)
{
  this->quat[0] = -this->quat[0];
  this->quat[1] = -this->quat[1];
  this->quat[2] = -this->quat[2];
  this->quat[3] =  this->quat[3]; // <=
  return *this;
}

GNU Octave

V570 The 'i' variable is assigned to itself. sparse.cc 144


template <class T>
void Sparse<T>::SparseRep::maybe_compress(bool remove_zeros)
{
  ....
  octave_idx_type i = 0;
  for (octave_idx_type j = 1; j <= ncols; j++)
  {
    octave_idx_type u = c[j];
    for (i = i; i < u; i++)            // <=
      if (d[i] != T())
      {
        d[k] = d[i];
        r[k++] = r[i];
      }
    c[j] = k;
  }
 ....
}

Similar errors can be found in some other places:

  • V570 The 'i' variable is assigned to itself. sparse.cc 967

FreeSWITCH

V570 The variable is assigned to itself. skypopen_protocol.c 1512


struct SkypopenHandles {
  HWND win32_hInit_MainWindowHandle;
  HWND win32_hGlobal_SkypeAPIWindowHandle;
  ....
};

LRESULT APIENTRY skypopen_present(...., WPARAM uiParam, ....)
{
 ....
 if (!tech_pvt->SkypopenHandles.currentuserhandle) {
   tech_pvt->SkypopenHandles.api_connected = 1;
   tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle =
    (HWND) uiParam;
   tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle =
    tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle;
 }
 ....
}

Unreal Engine 4

V570 The 'Position' variable is assigned to itself. drawelements.h 435


class FSlateDrawElement
{
  ....
  FORCEINLINE void SetPosition(const FVector2D& InPosition)
  { Position = Position; }
  ....
  FVector2D Position;
  ....
};

ChakraCore

V570 The 'this->isInlined' variable is assigned to itself. functioncodegenjittimedata.h 625


void SetupRecursiveInlineeChain(
    Recycler *const recycler,
    const ProfileId profiledCallSiteId)
{
  if (!inlinees)
  {
    inlinees = RecyclerNewArrayZ(....);
  }
  inlinees[profiledCallSiteId] = this;
  inlineeCount++;
  this->isInlined = isInlined;   // <=
}

Similar errors can be found in some other places:

  • V570 The 'sym->m_isTaggableIntConst' variable is assigned to itself. linearscan.cpp 3170

FreeBSD Kernel

V570 The 'lenRecv' variable is assigned to itself. itdinit.c 271


osGLOBAL void
itdssGetOperatingOptionParams(....)
{
  ....
  /* to remove compiler warnings */
  pLastUsedChar   = pLastUsedChar;
  lenRecv         = lenRecv;
  subkey2         = subkey2;
  subkey1         = subkey1;
  key             = key;
  buffer          = &tmpBuffer[0];
  buffLen         = sizeof (tmpBuffer);
  ....
}

Oracle VM Virtual Box

V570 The 'from->eval1D[i].u1' variable is assigned to itself. state_evaluators.c 1006


void
crStateEvaluatorDiff(CREvaluatorBits *e, CRbitvalue *bitID,
                     CRContext *fromCtx, CRContext *toCtx)
{
  ....
  from->eval1D[i].order = to->eval1D[i].order;
  from->eval1D[i].u1 = from->eval1D[i].u1;     // <=
  from->eval1D[i].u2 = from->eval1D[i].u2;     // <=
  ....
}

Similar errors can be found in some other places:

  • V570 The 'from->eval1D[i].u2' variable is assigned to itself. state_evaluators.c 1007
  • V570 The 'from->eval2D[i].u1' variable is assigned to itself. state_evaluators.c 1042
  • V570 The 'from->eval2D[i].u2' variable is assigned to itself. state_evaluators.c 1043
  • And 2 additional diagnostic messages.

The GTK+ Project

V570 The 'tmp_info' variable is assigned to itself. gtkimcontextxim.c 442


static GtkXIMInfo *
get_im (....)
{
  ....
  GtkXIMInfo *info;
  ....
  info = NULL;
  tmp_list = open_ims;
  while (tmp_list)
    {
      ....
      else
        {
          tmp_info = tmp_info;           // <=
          break;
        }
      ....
    }
  if (info == NULL)
    {
      ....
    }
  ....
}

ReactOS

V570 The 'idButton' variable is assigned to itself. mainwindow.cpp 546


LRESULT CDeviceManager::OnNotify(_In_ LPARAM lParam)
{
  ....
  UINT_PTR idButton = lpttt->hdr.idFrom;
  switch (idButton)
  {
    ....
  }
  idButton = idButton; // <=
  ....
}

Open X-Ray Engine

V570 The 'value[0]' variable is assigned to itself. compiler_cover.cpp 260


void compute_cover_value (....)
{
  ....
  float    value    [8];
  ....
  if (value[0] < .999f) {
    value[0] = value[0];
  }
  ....
}

CryEngine V

V570 The 'runtimeData.entityId' variable is assigned to itself. behaviortreenodes_ai.cpp 1771


void ExecuteEnterScript(RuntimeData& runtimeData)
{
  ExecuteScript(m_enterScriptFunction, runtimeData.entityId);

  runtimeData.entityId = runtimeData.entityId; // <=
  runtimeData.executeExitScriptIfDestructed = true;
}

Steinberg SDKs

V570 The same value is assigned twice to the 'lpf' variable. mdaComboProcessor.cpp 274


void ComboProcessor::recalculate ()
{
  ....
  case 4: trim = 0.96f; lpf = filterFreq(1685.f);
      mix1 = -0.85f; mix2 = 0.41f;
      del1 = int (getSampleRate () / 6546.f);
      del2 = int (getSampleRate () / 3315.f);
      break;

  case 5: trim = 0.59f; lpf = lpf = filterFreq(2795.f); // <=
      mix1 = -0.29f; mix2 = 0.38f;
      del1 = int (getSampleRate () / 982.f);
      del2 = int (getSampleRate () / 2402.f);
      hpf = filterFreq(459.f);
      break;
  ....
}

Amazon Lumberyard

V570 The 'behaviorParams.ignoreOnVehicleDestroyed' variable is assigned to itself. vehiclecomponent.cpp 168


bool CVehicleComponent::Init(....)
{
  ....
  if (!damageBehaviorTable.getAttr(....)
  {
    behaviorParams.ignoreOnVehicleDestroyed = false;
  }
  else
  {
    behaviorParams.ignoreOnVehicleDestroyed =      // <=
      behaviorParams.ignoreOnVehicleDestroyed;     // <=
  }
  ....
}
bValue = !bValue

Azure Service Fabric

V570 The 'statusDetails_' variable is assigned to itself. ComposeDeploymentStatusQueryResult.cpp 49


ComposeDeploymentStatusQueryResult &
ComposeDeploymentStatusQueryResult::operator = (
  ComposeDeploymentStatusQueryResult && other)        // <=
{
  if (this != & other)
  {
    deploymentName_ = move(other.deploymentName_);
    applicationName_ = move(other.applicationName_);
    dockerComposeDeploymentStatus_ = move(other....);
    statusDetails_ = move(statusDetails_);            // <=
  }

  return *this;
}

Vangers: One For The Road

V570 The same value is assigned twice to the 'ExternalSensor' variable. mechos.cpp 5828


struct VangerUnit : TrackUnit, uvsUnitType, aiFactorType
{
  ....
  int ExternalMode, ExternalTime, ExternalLock,
      ExternalDraw, ExternalAngle;
  int ExternalTime2;
  SensorDataType *ExternalObject;
  SensorDataType *ExternalLastSensor;
  SensorDataType *ExternalSensor;
  int RandomUpdate;
  ....
};

void VangerUnit::CreateVangerUnit(void)
{
  ....
  DoorFlag = 0;
  ExternalMode = EXTERNAL_MODE_NORMAL;
  ExternalTime = 0;
  ExternalLock = 0;
  ExternalDraw = 1;
  ExternalObject = ExternalSensor = ExternalSensor = NULL; // <=
  ExternalTime2 = 0;
  ExternalAngle = 0;
  Go2World();
  ....
};

Similar errors can be found in some other places:

  • V570 The same value is assigned twice to the 'ExternalSensor' variable. mechos.cpp 13967

0 A.D.

V570 The 'ptr' variable is assigned to itself. FUTracker.h 122


FUTrackedPtr(ObjectClass* _ptr = NULL) : ptr(_ptr)
{
  if (ptr != NULL) FUTracker::TrackObject((FUTrackable*) ptr);
  ptr = ptr;
}

NCBI Genome Workbench

V570 The 'm_onClickFunction' variable is assigned to itself. alngraphic.hpp 103


void SetOnClickFunctionName(string onClickFunction) {
  m_onClickFunction = m_onClickFunction;
}

Similar errors can be found in some other places:

  • V570 The 'iter->level' variable is assigned to itself. align_format_util.cpp 189
  • V570 The 'd_elements_values[ind]' variable is assigned to itself. sls_alp_data.cpp 1416

LLVM/Clang

V570 The 'Identifier->Type' variable is assigned to itself. FormatTokenLexer.cpp 249


bool FormatTokenLexer::tryMergeCSharpNullConditionals() {
  ....
  auto &Identifier = *(Tokens.end() - 2);
  auto &Question = *(Tokens.end() - 1);
  ....
  Identifier->ColumnWidth += Question->ColumnWidth;
  Identifier->Type = Identifier->Type;                    // <=
  Tokens.erase(Tokens.end() - 1);
  return true;
}

Haiku Operation System

V570 The 'wPipeIndex' variable is assigned to itself. CEchoGals_transport.cpp 244


ECHOSTATUS CEchoGals::CloseAudio (....)
{
  ....
  wPipeIndex = wPipeIndex;
  m_ProcessId[ wPipeIndex ] = NULL;
  m_Pipes[ wPipeIndex ].wInterleave = 0;
  ....
}

Heawei Ark Compiler

V570 The 'theDoubleVal' variable is assigned to itself. lexer.cpp 283


int64 theIntVal = 0;
float theFloatVal = 0.0;
double theDoubleVal = 0.0;

TokenKind MIRLexer
::GetFloatConst(uint32 valStart, uint32 startIdx, bool negative) {
  ....
  theIntVal = static_cast<int>(theFloatVal);
  theDoubleVal = static_cast<double>(theDoubleVal); // <=
  if (theFloatVal == -0) {
    theDoubleVal = -theDoubleVal;
  }
  ....
}

GCC

V570 The 'ctx->outer_reduction_clauses' variable is assigned to itself. omp-low.c 935


static omp_context *
new_omp_context (gimple *stmt, omp_context *outer_ctx)
{
  omp_context *ctx = XCNEW (omp_context);

  splay_tree_insert (all_contexts, (splay_tree_key) stmt,
         (splay_tree_value) ctx);
  ctx->stmt = stmt;

  if (outer_ctx)
    {
      ctx->outer = outer_ctx;
      ctx->cb = outer_ctx->cb;
      ctx->cb.block = NULL;
      ctx->local_reduction_clauses = NULL;
      ctx->outer_reduction_clauses = ctx->outer_reduction_clauses;  // <=
      ctx->depth = outer_ctx->depth + 1;
    }
  ....
}

Command & Conquer

V570 The 'hdr->MagicNumber' variable is assigned to itself. COMBUF.CPP 806


struct CommHdr {
  unsigned short MagicNumber;
  unsigned char Code;
  unsigned long PacketID;
} *hdr;

void CommBufferClass::Mono_Debug_Print(int refresh)
{
  ....
  hdr = (CommHdr *)SendQueue[i].Buffer;
  hdr->MagicNumber = hdr->MagicNumber;
  hdr->Code = hdr->Code;
  ....
}

Similar errors can be found in some other places:

  • V570 The 'hdr->Code' variable is assigned to itself. COMBUF.CPP 807
  • V570 The 'hdr->MagicNumber' variable is assigned to itself. COMBUF.CPP 931
  • V570 The 'hdr->Code' variable is assigned to itself. COMBUF.CPP 932
  • And 10 additional diagnostic messages.

Popular related articles
PVS-Studio for Java

Date: Jan 17 2019

Author: Andrey Karpov

In the seventh version of the PVS-Studio static analyzer, we added support of the Java language. It's time for a brief story of how we've started making support of the Java language, how far we've co…
The Evil within the Comparison Functions

Date: May 19 2017

Author: Andrey Karpov

Perhaps, readers remember my article titled "Last line effect". It describes a pattern I've once noticed: in most cases programmers make an error in the last line of similar text blocks. Now I want t…
Technologies used in the PVS-Studio code analyzer for finding bugs and potential vulnerabilities

Date: Nov 21 2018

Author: Andrey Karpov

A brief description of technologies used in the PVS-Studio tool, which let us effectively detect a large number of error patterns and potential vulnerabilities. The article describes the implementati…
Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Date: Jul 31 2017

Author: Andrey Karpov

After I wrote quite a big article about the analysis of the Tizen OS code, I received a large number of questions concerning the percentage of false positives and the density of errors (how many erro…
The Ultimate Question of Programming, Refactoring, and Everything

Date: Apr 14 2016

Author: Andrey Karpov

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort. The au…
The Last Line Effect

Date: May 31 2014

Author: Andrey Karpov

I have studied many errors caused by the use of the Copy-Paste method, and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have ne…
PVS-Studio ROI

Date: Jan 30 2019

Author: Andrey Karpov

Occasionally, we're asked a question, what monetary value the company will receive from using PVS-Studio. We decided to draw up a response in the form of an article and provide tables, which will sho…
How PVS-Studio Proved to Be More Attentive Than Three and a Half Programmers

Date: Oct 22 2018

Author: Andrey Karpov

Just like other static analyzers, PVS-Studio often produces false positives. What you are about to read is a short story where I'll tell you how PVS-Studio proved, just one more time, to be more atte…
Appreciate Static Code Analysis!

Date: Oct 16 2017

Author: Andrey Karpov

I am really astonished by the capabilities of static code analysis even though I am one of the developers of PVS-Studio analyzer myself. The tool surprised me the other day as it turned out to be sma…
Free PVS-Studio for those who develops open source projects

Date: Dec 22 2018

Author: Andrey Karpov

On the New 2019 year's eve, a PVS-Studio team decided to make a nice gift for all contributors of open-source projects hosted on GitHub, GitLab or Bitbucket. They are given free usage of PVS-Studio s…

Comments (0)

Next comments

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →
Accept