octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55347] PVS studio static analysis report


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #55347] PVS studio static analysis report
Date: Mon, 7 Jan 2019 11:59:22 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #38, bug #55347 (project octave):

All the reports about idx-vector.h appear to be about the same thing.

The idx_vector functions index, assign, fill, loop, and bloop can't be virtual
because they are templates.  So they use a switch statement to dispatch to the
various types of idx_vector objects that we have and perform a dynamic_cast on
the rep pointer.  If we somehow got the type wrong the dynamic_cast would fail
and return nullptr.  I'm not sure what the best fix is here.  Use assert to
check that the pointer is valid?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55347>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]