base: bug in copy constructor of Signal

The copy constructor of Signal did not copy the Signal::Data contents of
the copy source. This bug could survive undetected because the compiler
can optimize code in a way, that copy constructor and destructor are not
necessary when returning by value from simple functions. I assume that
it creates the object in CPU registers instead of RAM and reuses it
instead of copying it to save time. This way the bug triggered first
after wait_for_signal was changed in a way that avoided optimization.

ref #912
This commit is contained in:
Martin Stein 2013-10-15 11:12:29 +02:00 committed by Norman Feske
parent f845be8c23
commit 618b83499c

View File

@ -23,7 +23,13 @@ using namespace Genode;
** Signal ** ** Signal **
************/ ************/
Signal::Signal(Signal const &other) { _inc_ref(); } Signal::Signal(Signal const &other)
{
_data.context = other._data.context;
_data.num = other._data.num;
_inc_ref();
}
Signal & Signal::operator=(Signal const &other) Signal & Signal::operator=(Signal const &other)