Examples of errors detected by the V607 diagnostic

V607. Ownerless expression 'Foo'.


IPP Samples

V607 Ownerless expression 'state->com.m_channel_number'. aac_dec aac_dec_api_fp.c 1404


AACStatus bsacdecSetNumChannels(Ipp32s channelConfiguration,
                                AACDec *state)
{
  state->com.m_channel_number = channelConfiguration;
  if (channelConfiguration == 7) {
    state->com.m_channel_number;    // <=
  }

  return AAC_OK;
}

Trans-Proteomic Pipeline

V607 Ownerless expression '* iLenSeq'. Comet_fastadb comet-fastadb1.cxx 2241


void TRANSLATE(int iFrame,
      char *szNewSeq,
      char *szSeq,
      int  *iLenSeq)
{
  ...
  *iLenSeq;
}

Windows 8 Driver Samples

V607 Ownerless expression 'pDevExt->WdfDevice'. uart16550pc.cpp 58


NTSTATUS
UartInitContext(_In_ WDFDEVICE Device)
{
  ....
  pDevExt->WdfDevice;
  ....
}

TortoiseSVN

V607 Ownerless expression 'app.hwndTT'. tortoiseblame.cpp 1782


BOOL InitInstance(HINSTANCE hResource, int nCmdShow)
{
  ....
  app.hwndTT; // handle to the ToolTip control
  ....
}

Boost (C++ libraries)

V607 Ownerless expression 'duration_style_ == style'. base_formatter.hpp 51


void set_duration_style(duration_style style)
{
  duration_style_ == style;
}

Trans-Proteomic Pipeline

V607 Ownerless expression 'done_[charge]'. mixturemodel.cxx 1558


Boolean MixtureModel::iterate(int counter) {
  ....
  if (done_[charge] < 0) {
    done_[charge];
  }
  else if (priors_[charge] > 0.0) {
    done_[charge] += extraitrs_;
  }
  ....
}

CryEngine 3 SDK

V607 Ownerless expression 'insertResult.first->second.m_entityId'. persistantstats.cpp 4814


CPersistantStats::SEnemyTeamMemberInfo *
CPersistantStats::GetEnemyTeamMemberInfo(EntityId inEntityId)
{
  ....
  insertResult.first->second.m_entityId;
  ....
}

Identical errors can be found in some other places:

  • V607 Ownerless expression 'initialState.weapon.weaponId'. recordingsystem.cpp 2671

Eigen

V607 Ownerless expression 'v1[0]'. miscmatrices.cpp 28


template<typename MatrixType> void miscMatrices(
  const MatrixType& m)
{
  ....
  VectorType v1 = VectorType::Random(rows);
  v1[0];
  ....
}

Unreal Engine 4

V607 Ownerless expression 'NumByteProperties'. codegenerator.cpp 633


void FNativeClassHeaderGenerator::ExportProperties(....)
{
  ....
  int32 NumByteProperties = 0;
  ....
  if (bIsByteProperty)
  {
    NumByteProperties;
  }
  ....
}

Miranda NG

V607 Ownerless expression 'ccs->wParam'. MirOTR svcs_proto.cpp 103


INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
  ....
  CCSDATA *ccs = (CCSDATA *) lParam;
  ....
  if (otr_context_get_trust(context) >= TRUST_UNVERIFIED)
    ccs->wParam;
  ....
}

Identical errors can be found in some other places:

  • V607 Ownerless expression 'm_hDDIcon'. HistoryStats bandctrlimpl.cpp 226

Godot Engine

V607 Ownerless expression 'm_angularLimits[p_axis].m_limitSoftness'. generic_6dof_joint_sw.cpp 539


void Generic6DOFJointSW::set_param(....)
{
  ERR_FAIL_INDEX(p_axis,3);
  switch(p_param)
  {
    case PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT:
    {
      m_linearLimits.m_lowerLimit[p_axis]=p_value;
    } break;
    case PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT:
    {
      m_linearLimits.m_upperLimit[p_axis]=p_value;
    } break;
    ....
    case PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS:
    {
      m_angularLimits[p_axis].m_limitSoftness;  // <=
    } break;
    case PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING:
    {
      m_angularLimits[p_axis].m_damping=p_value;
    } break;
    ....
  }
}

Godot Engine

V607 Ownerless expression 'ie.action.pressed'. variant_op.cpp 2410


Variant Variant::get(const Variant& p_index, bool *r_valid) const
{
  ....
  if (ie.type == InputEvent::ACTION)
  {
    if (str =="action")
    {
      valid=true;
      return ie.action.action;
    }
    else if (str == "pressed")
    {
      valid=true;
      ie.action.pressed;  // <=
    }
  }
  ....
}

Serious Engine 1 v.1.10

V607 Ownerless expression 'pdecDLLClass->dec_ctProperties'. entityproperties.cpp 107


void CEntity::ReadProperties_t(CTStream &istrm) // throw char *
{
  ....
  CDLLEntityClass *pdecDLLClass = en_pecClass->ec_pdecDLLClass;
  ....
  // for all saved properties
  for(INDEX iProperty=0; iProperty<ctProperties; iProperty++) {
    pdecDLLClass->dec_ctProperties;  // <=
    ....
  }
  ....
}


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++ and C#

goto PVS-Studio;