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
- Use shared pointers for factory methods
I think the use of shared pointers in `symbolicallyExecute` is the
correct decision due to the filling of a map. I tried for a while to
make this a map of objects, but due to [object
slicing](https://en.wikipedia.org/wiki/Object_slicing) it would not be
possible to store a PredicatedValueBits in this map. (This would require
PredicatedValueBits to be redesigned into ValueBits class, but then the
internal methods get messy. Virtual functions was a clean answer to
this) Additionally, using `unique_ptr` proves difficult due to having to
store it in a map. And unique pointers cannot be copied. As
`symbolicallyExecute` is the primary user of the factory methods, it
made sense for the factory methods to return a shared pointer instead of
a raw pointer or object and then wrapping this in a shared pointer
within symbolicallyExecute.
- Have XOR bits own their LHS/RHS
Having them as member objects instead of pointers I don't think makes
much sense due to them not being needed for most ValueBit objects, but
they would have to be initialized for all ValueBit instantiations.
- Use object values instead of pointers for bit representation
IMO the cleanest way. They're very lightweight anyway.
0 commit comments