You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In c_pcb.cpp best_pcb is copy-constructed from current_pcb. Should current_pcb go out of scope, best_pcb would become compromised and result in segfaults when calling methods which would require the net-s it contains to refer to the pcb pointers inside them, as the pcb pointers are always pointing to current_pcb. While this works the way it is used, this architecture is brittle and unintuitive. I would suggest implementing a copy-constructor for pcb which would correctly update nets to contain pointers to the new instance. Hope this is intelligible.
The text was updated successfully, but these errors were encountered:
net
holds a pointer topcb
In c_pcb.cpp
best_pcb
is copy-constructed fromcurrent_pcb
. Shouldcurrent_pcb
go out of scope,best_pcb
would become compromised and result in segfaults when calling methods which would require thenet
-s it contains to refer to thepcb
pointers inside them, as thepcb
pointers are always pointing tocurrent_pcb
. While this works the way it is used, this architecture is brittle and unintuitive. I would suggest implementing a copy-constructor forpcb
which would correctly updatenets
to contain pointers to the new instance. Hope this is intelligible.The text was updated successfully, but these errors were encountered: