Skip to content

Ghidra is a software reverse engineering (SRE) framework

Copy constructor on LaneDescription

caheckman5ef7347ca3ce
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc
index f2139d79e3..d8fe8a05d9 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.cc
@@ -16,6 +16,15 @@
#include "transform.hh"
#include "funcdata.hh"
+/// \param op2 is the lane description to copy from
+LaneDescription::LaneDescription(const LaneDescription &op2)
+
+{
+ wholeSize = op2.wholeSize;
+ laneSize = op2.laneSize;
+ lanePosition = op2.lanePosition;
+}
+
/// Create lanes that are all the same size
/// \param origSize is the size of the whole in bytes
/// \param sz is the size of a lane in bytes
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh
index a388b3d811..9c5f106356 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/transform.hh
@@ -94,6 +94,7 @@ class LaneDescription {
vector<int4> laneSize; ///< Size of lanes in bytes
vector<int4> lanePosition; ///< Significance positions of lanes in bytes
public:
+ LaneDescription(const LaneDescription &op2); ///< Copy constructor
LaneDescription(int4 origSize,int4 sz); ///< Construct uniform lanes
LaneDescription(int4 origSize,int4 lo,int4 hi); ///< Construct two lanes of arbitrary size
int4 getNumLanes(void) const { return laneSize.size(); } ///< Get the total number of lanes