Skip to content

Ghidra is a software reverse engineering (SRE) framework

Sync startPos, curPos, endPos with new LinkedByteBuffer

caheckmanabac140f5f00
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/doccore.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/doccore.hh
index 8640982188..6d8698dac6 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/doccore.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/doccore.hh
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -75,7 +75,6 @@
prototype, and local symbol information.
- \ref classfuncdata
.
- .
\b Translation
- \ref classloadimage
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
index 4668b2ca89..9fb9bccaa1 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
@@ -2383,6 +2383,8 @@ ProtoModel::~ProtoModel(void)
delete input;
if (output != (ParamList *)0)
delete output;
+ for(int4 i=0;i<sharedActions.size();++i)
+ delete sharedActions[i];
}
/// Test whether one ProtoModel can substituted for another during FuncCallSpecs::deindirect
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
index ec38d11c13..72a823df98 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/marshal.cc
@@ -15,7 +15,6 @@
*/
#include "marshal.hh"
#include "translate.hh"
-#include "type.hh"
namespace ghidra {
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
index 55de3ff93b..cc4b68d42b 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
@@ -1014,7 +1014,7 @@ PcodeOp *PcodeOpBank::create(int4 inputs,const SeqNum &sq)
/// of input slots, which start out empty. A sequence number is assigned, and
/// the op is added to the end of the \e dead list.
/// \param inputs is the number of input slots
-/// \param pc is the Address to associate with the PcodeOp
+/// \param addr is the Address to associate with the PcodeOp
/// \return the newly allocated PcodeOp
PcodeOp *PcodeOpBank::createIndirect(int4 inputs,const Address &addr)
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
index 19b3496d84..c8f6e49467 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
@@ -10688,8 +10688,8 @@ int4 RuleLzcountShiftBool::applyOp(PcodeOp *op,Funcdata &data)
/// \brief Convert floating-point \e sign bit manipulation into FLOAT_ABS or FLOAT_NEG
///
/// Transform floating-point specific operations
-/// -- `x & 0x7fffffff => ABS(f)`
-/// -- 'x ^ 0x80000000 => -f`
+/// - `x & 0x7fffffff => ABS(f)`
+/// - `x ^ 0x80000000 => -f`
///
/// A Varnode is determined to be floating-point by participation in other floating-point operations,
/// not based on the data-type of the Varnode.
@@ -10776,8 +10776,8 @@ int4 RuleFloatSignCleanup::applyOp(PcodeOp *op,Funcdata &data)
/// \class RuleOrCompare
/// \brief Simplify INT_OR in comparisons with 0.
///
-/// `(V | W) == 0` => '(V == 0) && (W == 0)'
-/// `(V | W) != 0` => '(V != 0) || (W != 0)'
+/// - `(V | W) == 0 => (V == 0) && (W == 0)`
+/// - `(V | W) != 0 => (V != 0) || (W != 0)`
void RuleOrCompare::getOpList(vector<uint4> &oplist) const
{
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
index 40370a3634..0932215b88 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.cc
@@ -19,7 +19,7 @@
namespace ghidra {
/// The base propagation ordering associated with each meta-type.
-/// The array elements correspond to the ordering of #type_metatype.
+/// The array elements correspond to the ordering of type_metatype.
sub_metatype Datatype::base2sub[18] = {
SUB_PARTIALUNION, SUB_PARTIALSTRUCT, SUB_UINT_PARTIALENUM, SUB_UNION, SUB_STRUCT, SUB_INT_ENUM, SUB_UINT_ENUM,
SUB_ARRAY, SUB_PTRREL, SUB_PTR, SUB_FLOAT, SUB_CODE, SUB_BOOL, SUB_UINT_PLAIN, SUB_INT_PLAIN, SUB_UNKNOWN,
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh b/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
index f85825ccd4..9e71e1939d 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/type.hh
@@ -76,7 +76,7 @@ extern void print_data(ostream &s,uint1 *buffer,int4 size,const Address &baseadd
//extern void print_char(ostream &s,int4 onechar);
//extern bool print_string(ostream &s,uint1 *buffer,int4 size);
-/// Specializations of the core meta-types. Each enumeration is associated with a specific #type_metatype.
+/// Specializations of the core meta-types. Each enumeration is associated with a specific type_metatype.
/// Ordering is important: The lower the number, the more \b specific the data-type, affecting propagation.
enum sub_metatype {
SUB_VOID = 23, ///< Compare as a TYPE_VOID
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PackedDecode.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PackedDecode.java
index 38c9d44b4c..6c01a34648 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PackedDecode.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PackedDecode.java
@@ -120,9 +120,6 @@ public class PackedDecode implements Decoder, Closeable {
curPos = new LinkedByteBuffer.Position();
endPos = new LinkedByteBuffer.Position();
open(Integer.MAX_VALUE, desc);
- startPos.buffer = inStream;
- curPos.buffer = inStream;
- endPos.buffer = inStream;
inStream.ingestStreamAsNeeded(stream, endPos);
}
@@ -224,6 +221,9 @@ public class PackedDecode implements Decoder, Closeable {
@Override
public void open(int max, String desc) {
inStream = new LinkedByteBuffer(max, ELEMENT_END, desc);
+ startPos.buffer = inStream;
+ curPos.buffer = inStream;
+ endPos.buffer = inStream;
}
/**