bugGNU CSSC - Bugs: bug #54497, [patch] mylist implementation...

 
 

bug #54497: [patch] mylist implementation error segfaults with g++-8

Submitted by:  Yann Dirson <ydirson>
Submitted on:  Sat 11 Aug 2018 09:37:53 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 11 Aug 2018 09:37:53 PM UTC, original submission:

With g++-8 self-tests fail with:

[ RUN ] MylistTest.Catenate
Segmentation fault

This is due to operator+= and -= not returning anything, looks like it only ever worked by chance with previous versions of the compiler - g++ does show a warning where the problems are:

unit-tests$ make CC=gcc-8 CXX=g++-8 test_mylist
g++-8 -DHAVE_CONFIG_H -I. -I.. -I./googletest//include -pthread -I./../src -pthread -DGTEST_HAS_PTHREAD=1 -g -O2 -MT test_mylist.o -MD -MP -MF .deps/test_mylist.Tpo -c -o test_mylist.o test
_mylist.cc
In file included from test_mylist.cc:24:
./../src/mylist.h: In instantiation of ‘const mylist<TYPE>& mylist<TYPE>::operator+=(const mylist<TYPE>&) [with TYPE = int]’:
test_mylist.cc:70:8: required from here
./../src/mylist.h:106:3: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
./../src/mylist.h: In instantiation of ‘const mylist<TYPE>& mylist<TYPE>::operator-=(const mylist<TYPE>&) [with TYPE = int]’:
test_mylist.cc:82:8: required from here
./../src/mylist.h:125:3: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
mv -f .deps/test_mylist.Tpo .deps/test_mylist.Po

Bug-Debian: https://bugs.debian.org/897731
Last-Update: 2018-08-11

--- cssc-1.4.0.orig/src/mylist.h
+++ cssc-1.4.0/src/mylist.h
@@ -103,6 +103,7 @@ public:
{
items_.push_back(*ci);
}
+ return *this;
}

const mylist<TYPE>& operator-=(const mylist& other)
@@ -122,6 +123,7 @@ public:
}
items_.swap(remaining);
}
+ return *this;
}

Yann Dirson <ydirson>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ydirson (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.3