You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/09/25 02:11:50 UTC

[jira] Updated: (STDCXX-237) SIGFPE in std::operator%(slice, slice)

     [ https://issues.apache.org/jira/browse/STDCXX-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor updated STDCXX-237:
--------------------------------

         Severity: Runtime Error
    Fix Version/s:     (was: 4.2)
                   5.0

Scheduled for 5.0 since, like STDCXX-448, the fix is binary incompatible.

> SIGFPE in std::operator%(slice, slice)
> --------------------------------------
>
>                 Key: STDCXX-237
>                 URL: https://issues.apache.org/jira/browse/STDCXX-237
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 5.0
>
>
> Moved from the Rogue Wave bug tracking database:
> ****Created By: sebor @ Apr 27, 2000 10:43:55 PM****
> Subject: valarray/gslice problem
> Date: Fri, 21 Apr 2000 04:18:09 -0700
> From: Dennis Handly <dh...@hpcllmx.cup.hp.com>
> To: sebor@roguewave.com
> CC: dhandly@hpcllmx.cup.hp.com, wanc@cup.hp.com
> The following test fails with a SIGFPE (% by 0):
> #include <valarray>
> int main() {
>    std::valarray<int> ival;
>    std::gslice test_gslice;
>    std::operator%<int>(ival[test_gslice], ival[test_gslice]);
> }
> test_gslice should select no elements.
> I think the problem is in <valarray>:
> inline size_t gslice::ind_numb() const
> {
>     size_t value = 1;
>     for(size_t ind=0; ind< length_.size(); ind++ )
>         value*= length_[ind];
>     return value;
> }
> This doesn't return 0 if length_.size() is 0.
> ****Modified By: sebor @ May 18, 2000 12:01:47 PM****
> Subject: Re: valarray/gslice problem
> Date: Thu, 11 May 2000 22:14:58 -0700
> From: Dennis Handly <dh...@hpcllmx.cup.hp.com>
> To: sebor@roguewave.com
> CC: dhandly@hpcllmx.cup.hp.com, wanc@cup.hp.com
> >The incident number is 22770.
> I changed valarray to check for 0 and return 0:
> inline size_t gslice::ind_numb() const
> {
>     size_t value = 1;
>     register size_t lsize = _C_length.size();
>     if (lsize == 0)
>        return 0;
>     for(size_t __i=0; __i < lsize; __i++ )

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.