Branch: refs/heads/kupsch/fix-instruction-class-formatter
  Home:   https://github.com/dyninst/dyninst
  Commit: 1e37b807a802d6fa7add90b867e5fa5f9e371c4d
      
https://github.com/dyninst/dyninst/commit/1e37b807a802d6fa7add90b867e5fa5f9e371c4d
  Author: James A. Kupsch <kup...@cs.wisc.edu>
  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.


_______________________________________________
Dyninst-api mailing list
Dyninst-api@cs.wisc.edu
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api

Reply via email to