Branch: refs/heads/kupsch/fix-instruction-class-formatter Home: https://github.com/dyninst/dyninst Commit: 64ddbfa954d11a24836f43bf34da82e7b58d8b2c https://github.com/dyninst/dyninst/commit/64ddbfa954d11a24836f43bf34da82e7b58d8b2c Author: James A. Kupsch <kup...@cs.wisc.edu> Date: 2022-11-14 (Mon, 14 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. * Change Instruction::format to return an error string if the arch is set to Arch_none (default constructed, to prevent nullptr dereference) _______________________________________________ Dyninst-api mailing list Dyninst-api@cs.wisc.edu https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api