1- From b25de9d74c90bd1216e10b5697a27c3815641621 Mon Sep 17 00:00:00 2001
1+ From 54276cc9def6836b02a3f77471b84a7a096eb8ec Mon Sep 17 00:00:00 2001
22From: Eric Kilmer <eric.d.kilmer@gmail.com>
33Date: Mon, 12 Aug 2024 12:02:35 -0400
4- Subject: [PATCH 1/6 ] Fix UBSAN errors in decompiler
4+ Subject: [PATCH 1/7 ] Fix UBSAN errors in decompiler
55
66Co-authored-by: Alex Cameron <asc@tetsuo.sh>
77---
@@ -18,10 +18,10 @@ Co-authored-by: Alex Cameron <asc@tetsuo.sh>
1818 10 files changed, 44 insertions(+), 18 deletions(-)
1919
2020diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
21- index 3e9f310446..c903810382 100644
21+ index cafce3f7ba..b696fe6879 100644
2222--- a/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
2323+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/fspec.cc
24- @@ -2868 ,8 +2868 ,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
24+ @@ -2893 ,8 +2893 ,12 @@ void ProtoModelMerged::decode(Decoder &decoder)
2525 modellist.push_back(mymodel);
2626 }
2727 decoder.closeElement(elemId);
@@ -37,7 +37,7 @@ index 3e9f310446..c903810382 100644
3737
3838 void ParameterBasic::setTypeLock(bool val)
3939diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
40- index e165951fe6..00169e22e5 100644
40+ index a62ee56fc3..66bcd48db0 100644
4141--- a/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
4242+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/op.cc
4343@@ -666,7 +666,11 @@ uintb PcodeOp::getNZMaskLocal(bool cliploop) const
@@ -116,7 +116,7 @@ index ca9d71ab99..85d4dd281d 100644
116116 return res;
117117 }
118118diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
119- index b7fda34cc9..a3d164aa2d 100644
119+ index 2b4a9474e5..aa86e740b2 100644
120120--- a/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
121121+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/ruleaction.cc
122122@@ -976,7 +976,12 @@ int4 RulePullsubIndirect::applyOp(PcodeOp *op,Funcdata &data)
@@ -133,7 +133,7 @@ index b7fda34cc9..a3d164aa2d 100644
133133 consume = ~consume;
134134 if ((consume & indir->getIn(0)->getConsume())!=0) return 0;
135135
136- @@ -7288 ,8 +7293 ,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
136+ @@ -7298 ,8 +7303 ,9 @@ int4 RulePtrsubCharConstant::applyOp(PcodeOp *op,Funcdata &data)
137137 Varnode *sb = op->getIn(0);
138138 Datatype *sbType = sb->getTypeReadFacing(op);
139139 if (sbType->getMetatype() != TYPE_PTR) return 0;
@@ -220,5 +220,5 @@ index 2571f55f1a..fe40e22b1b 100644
220220 uintb true_result = ((uintb)(int32_t)f) & 0xffffffff;
221221 uintb encoding = format.getEncoding(f);
222222- -
223- 2.49.0
223+ 2.50.1
224224
0 commit comments