Examples of errors detected by the V779 diagnostic.


V779. Unreachable code detected. It is possible that an error is present.


Far2l

V779 Unreachable code detected. It is possible that an error is present. 7z.cpp 203


BOOL WINAPI _export SEVENZ_OpenArchive(const char *Name,
                                       int *Type)
{
  Traverser *t = new Traverser(Name);
  if (!t->Valid())
  {
    return FALSE;
    delete t;          // <=
  }

  delete s_selected_traverser;
  s_selected_traverser = t;
  return TRUE;
}

FreeBSD Kernel

V779 Unreachable code detected. It is possible that an error is present. if_wi_pci.c 258


static int
wi_pci_resume(device_t dev)
{
  struct wi_softc  *sc = device_get_softc(dev);
  struct ieee80211com *ic = &sc->sc_ic;

  WI_LOCK(sc);
  if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) {
    return (0);                                 // <=
    WI_UNLOCK(sc);                              // <=
  }
  if (ic->ic_nrunning > 0)
    wi_init(sc);
  WI_UNLOCK(sc);
  return (0);
}

Valgrind

V779 Unreachable code detected. It is possible that an error is present. host_arm_isel.c 461


static
Bool doHelperCallWithArgsOnStack ( UInt*   stackAdjustAfterCall,
                                   RetLoc* retloc,
                                   ISelEnv* env,
                                   IRExpr* guard,
                                   IRCallee* cee, IRType retTy,
                                   IRExpr** args )
{
  ....
   if (guard) {
      if (guard->tag == Iex_Const
          && guard->Iex.Const.con->tag == Ico_U1
          && guard->Iex.Const.con->Ico.U1 == True) {
         /* unconditional -- do nothing */
      } else {
         goto no_match; //ATC                   // <=
         cc = iselCondCode( env, guard );       // <=
      }
   }
  ....
}

EFL Core Libraries

V779 Unreachable code detected. It is possible that an error is present. timeout.c 30


extern void _exit (int __status) __attribute__ ((__noreturn__));

static void
_timeout(int val)
{
  _exit(-1);
  if (val) return;
}

EFL Core Libraries

V779 Unreachable code detected. It is possible that an error is present. edje_cc_out.c 1102


void
error_and_abort(Eet_File *ef EINA_UNUSED, const char *fmt, ...)
{
   va_list ap;

   va_start(ap, fmt);
   eina_log_vprint(_edje_cc_log_dom, EINA_LOG_LEVEL_CRITICAL,
                   "unknown", "unknown", 0, fmt, ap);
   va_end(ap);
   unlink(file_out);
   if (watchfile) unlink(watchfile);
   exit(-1);
}

static void
data_thread_image_end(....)
{
  ....
  if (iw->errstr)
  {
    error_and_abort(iw->ef, iw->errstr);                   // <=
    free(iw->errstr);                                      // <=
  }
  ...
}

Similar errors can be found in some other places:

  • V779 Unreachable code detected. It is possible that an error is present. evas_gl_core.c 483
  • V779 Unreachable code detected. It is possible that an error is present. edje_cc_out.c 737
  • V779 Unreachable code detected. It is possible that an error is present. edje_cc_out.c 835
  • And 12 additional diagnostic messages.

Tizen

V779 Unreachable code detected. It is possible that an error is present. bt-hdp.c 295


static int __bt_hdp_internal_add_filter(void)
{
  BT_DBG("+");

  if (g_hdp_dus_conn) {
    BT_ERR("g_hdp_dus_conn already exist");
    return BLUETOOTH_ERROR_NONE;
  }

  g_hdp_dus_conn = _bt_gdbus_get_system_gconn();
  retv_if(g_hdp_dus_conn == NULL, BLUETOOTH_ERROR_INTERNAL);

  return __bt_hdp_add_filter_subscribe_signal(g_hdp_dus_conn,
                                              TRUE);

  BT_DBG("-\n");                                           // <=
}

Tizen

V779 Unreachable code detected. It is possible that an error is present. Integrity.cpp 233


void Integrity::createHardLink(....) {
  int ret = link(oldName.c_str(), newName.c_str());

  if (ret < 0) {
    int err = errno;
    throw UnexpectedErrorException(err, strerror(err));
    LOGN("Trying to link to non-existent...", oldName.c_str());
  }
}

Tizen

V779 Unreachable code detected. It is possible that an error is present. myplace-suggest.c 68


#define LS_FUNC_ENTER LS_LOGD("(%s) ENTER", __FUNCTION__);
#define LS_FUNC_EXIT  LS_LOGD("(%s) EXIT", __FUNCTION__);

static bool __check_myplace_automation(void)
{
  LS_FUNC_ENTER
  bool myplace_automation_supported = false;
  bool myplace_automation_consent = false;
  ....
  return false;
  LS_FUNC_EXIT
}

Tizen

V779 Unreachable code detected. It is possible that an error is present. setting-common-view.c 124


#define SETTING_TRACE_END  do {\
    SECURE_LOGD("\033[0;35mEXIT FUNCTION: %s. \033[0m\n", \
      __FUNCTION__);\
} while (0)

EXPORT_PUBLIC
setting_view *setting_view_get_topview(setting_view *view)
{
  SETTING_TRACE_BEGIN;
  retv_if(NULL == view, NULL);
  int idx = 0;
  SettingViewNode *viewnode = NULL;
  ....

  if (viewnode && viewnode->topview)
    return viewnode->topview;
  else
    return NULL;

  SETTING_TRACE_END;                                       // <=
}

Tizen

V779 Unreachable code detected. It is possible that an error is present. ad-id.c 472


#define AI_FUNC_EXIT  AI_LOGD("(%s) EXIT", __FUNCTION__);

int main(int argc, char *argv[])
{
  AI_FUNC_ENTER

  int ret = APP_ERROR_NONE;
  ad_id_app_data_s ad = {0,};

  ....

  if (ret != APP_ERROR_NONE)
    AI_LOGE("ui_app_main() is failed. err=%d", ret);

  return 0;                                                // <=
  AI_FUNC_EXIT                                             // <=
}

Similar errors can be found in some other places:

  • V779 Unreachable code detected. It is possible that an error is present. myplace.c 197
  • V779 Unreachable code detected. It is possible that an error is present. layout_network.c 1666


Do you make errors in the code?

Check your code
with PVS-Studio

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

goto PVS-Studio;