mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-17 10:19:48 +00:00
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:
parent
f845be8c23
commit
618b83499c
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user