stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-237) SIGFPE in std::operator%(slice, slice)
Date Wed, 28 Jun 2006 19:51:29 GMT
SIGFPE in std::operator%(slice, slice)
--------------------------------------

         Key: STDCXX-237
         URL: http://issues.apache.org/jira/browse/STDCXX-237
     Project: C++ Standard Library
        Type: Bug

  Components: 26. Numerics  
    Reporter: Martin Sebor


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 <dhandly@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 <dhandly@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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message