Branch: refs/heads/kupsch/fix-instruction-class-formatter
Home: https://github.com/dyninst/dyninst
Commit: 94d64f688883d36f0a0f0b4f21b8a6ca418f370b
https://github.com/dyninst/dyninst/commit/94d64f688883d36f0a0f0b4f21b8a6ca418f370b
Author: James A. Kupsch <kupsch@xxxxxxxxxxx>
Date: 2022-11-13 (Sun, 13 Nov 2022)
Changed paths:
M instructionAPI/h/Instruction.h
M instructionAPI/src/Instruction.C
Log Message:
-----------
fix Instruction class to allow valid assignment
* Allow the Instruction class to allow correct assignment semantics by
changing a member from a reference to a pointer
* The formatter member is a reference (to a singleton) that can not be
changed after it is initialized. Assignment to this member wrongly
assigns to the previously bound referent singleton and wrongly slices
the rhs to the ArchSpecificFormatter base class. The base class has
no data members, and since the assignment does not change the type of
the object (its vtable), it appears to have no effect. Also a default
constructed Instuction object sets the formatter to the x86 formatter
even if the host was not x86.
|