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

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

[Octave-bug-tracker] [bug #61300] integer range might exceed upper limit


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #61300] integer range might exceed upper limit
Date: Sun, 28 Nov 2021 14:49:09 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.34

Follow-up Comment #22, bug #61300 (project octave):

IIUC, an array can't have more elements than the maximum of `octave_idx_type`.
`octave_idx_type` is either `int64_t` or `int32_t` depending on the platform.
The same should probably be valid for ranges. So, the assignment in comment
#20 should be save.

IIUC, in your examples in comment #21, the sum `m_limit.value () -
m_base.value () + m_increment.value ()` overflows. Would that be different if
the result would be cast to `int64_t`?

We might want to detect or avoid that overflow. But that is a different issue
imho.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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