From 5e4522fc3a2a547c9b1c94ab293890bb9f767ac3 Mon Sep 17 00:00:00 2001 From: Sleigh-InSPECtor Date: Tue, 9 Apr 2024 16:43:13 +0930 Subject: [PATCH 1/3] AA64: Change sha1h shift to rotate --- Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc b/Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc index 65a3b3b906..1d3ca2530f 100644 --- a/Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc +++ b/Ghidra/Processors/AARCH64/data/languages/AARCH64neon.sinc @@ -14460,7 +14460,7 @@ is b_2431=0b01011110 & b_2223=0b00 & b_2121=0 & Rm_VPR128.4S & b_1015=0b000000 & :sha1h Rd_FPR32, Rn_FPR32 is b_2431=0b01011110 & b_2223=0b00 & b_1721=0b10100 & b_1216=0b00000 & b_1011=0b10 & Rn_FPR32 & Rd_FPR32 & Zd { - Rd_FPR32 = Rn_FPR32 << 30:1; + Rd_FPR32 = Rn_FPR32 << 30:1 | (Rn_FPR32 >> 2:1); zext_zs(Zd); # zero upper 28 bytes of Zd } From 9a9b6cd063bc830c749804be0ab4213ec8de0010 Mon Sep 17 00:00:00 2001 From: caheckman <48068198+caheckman@users.noreply.github.com> Date: Thu, 29 Jan 2026 20:26:27 +0000 Subject: [PATCH 2/3] GP-6388 Adjust getInputCast for TypeOpPtradd and TypeOpPtrsub --- .../Decompiler/src/decompile/cpp/typeop.cc | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc index 549b10e824..5197e3eefd 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/typeop.cc @@ -2254,7 +2254,13 @@ Datatype *TypeOpPtradd::getInputCast(const PcodeOp *op,int4 slot,const CastStrat // not the (possibly different) type of the HIGH Datatype *reqtype = op->getIn(0)->getTypeReadFacing(op); Datatype *curtype = op->getIn(0)->getHighTypeReadFacing(op); - return castStrategy->castStandard(reqtype,curtype,false,false); + if (reqtype->getMetatype() != TYPE_PTR) return reqtype; + if (curtype->getMetatype() != TYPE_PTR) return reqtype; + Datatype *reqbase = ((TypePointer *)reqtype)->getPtrTo(); // Go down exactly one level + Datatype *curbase = ((TypePointer *)curtype)->getPtrTo(); + if (reqbase->getAlignSize() == curbase->getAlignSize()) + return (Datatype *)0; + return reqtype; } return TypeOp::getInputCast(op,slot,castStrategy); } @@ -2318,7 +2324,24 @@ Datatype *TypeOpPtrsub::getInputCast(const PcodeOp *op,int4 slot,const CastStrat // not the (possibly different) type of the HIGH Datatype *reqtype = op->getIn(0)->getTypeReadFacing(op); Datatype *curtype = op->getIn(0)->getHighTypeReadFacing(op); - return castStrategy->castStandard(reqtype,curtype,false,false); + if (curtype == reqtype) + return (Datatype *)0; + if (reqtype->getMetatype() != TYPE_PTR) return reqtype; + if (curtype->getMetatype() != TYPE_PTR) return reqtype; + Datatype *reqbase = ((TypePointer *)reqtype)->getPtrTo(); // Go down exactly one level + Datatype *curbase = ((TypePointer *)curtype)->getPtrTo(); + if (curbase->getMetatype() == TYPE_ARRAY && reqbase->getMetatype() == TYPE_ARRAY) { + curbase = ((TypeArray *)curbase)->getBase(); + reqbase = ((TypeArray *)reqbase)->getBase(); + } + while(reqbase->getTypedef() != (Datatype *)0) + reqbase = reqbase->getTypedef(); + while(curbase->getTypedef() != (Datatype *)0) + curbase = curbase->getTypedef(); + + if (curbase == reqbase) + return (Datatype *)0; + return reqtype; } return TypeOp::getInputCast(op,slot,castStrategy); } From 23a0e29f552269305eea5d48242a82d91b320694 Mon Sep 17 00:00:00 2001 From: d-millar <33498836+d-millar@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:12:31 +0000 Subject: [PATCH 3/3] GP-6376: Fixes null-pointer exception on closing the debugger. --- .../app/plugin/core/debug/gui/stack/DebuggerStackPanel.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java index 85473683ec..8689cb576d 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/stack/DebuggerStackPanel.java @@ -73,6 +73,9 @@ public class DebuggerStackPanel extends AbstractObjectsTableBasedPanel