diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
index 8eb11963ef..49dd39f4ea 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/double.cc
@@ -787,10 +787,14 @@ bool SplitVarnode::isAddrTiedContiguous(Varnode *lo,Varnode *hi,Address &res)
if (!hi->isAddrTied()) return false;
// Make sure there is no explicit symbol that would prevent the pieces from being joined
- SymbolEntry *entry = lo->getSymbolEntry();
- if ((entry != (SymbolEntry *)0)&&(entry->getOffset()==0)) return false;
- entry = hi->getSymbolEntry();
- if ((entry != (SymbolEntry *)0)&&(entry->getOffset()==0)) return false;
+ SymbolEntry *entryLo = lo->getSymbolEntry();
+ SymbolEntry *entryHi = hi->getSymbolEntry();
+ if (entryLo != (SymbolEntry *)0 || entryHi != (SymbolEntry *)0) {
+ if (entryLo == (SymbolEntry *)0 || entryHi == (SymbolEntry *)0)
+ return false; // One is marked with a symbol, the other is not
+ if (entryLo->getSymbol() != entryHi->getSymbol())
+ return false; // They are part of different symbols
+ }
AddrSpace *spc = lo->getSpace();
if (spc != hi->getSpace()) return false;
uintb looffset = lo->getOffset();
@@ -3093,6 +3097,12 @@ bool IndirectForm::verify(Varnode *h,Varnode *l,PcodeOp *ind)
if (affector != PcodeOp::getOpFromConst(indlo->getIn(1)->getAddr())) continue; // hi and lo must be affected by same op
reslo = indlo->getOut();
if (reslo->getSpace()->getType() == IPTR_INTERNAL) return false; // Indirect must not be through a temporary
+ if (reslo->isAddrTied() || reshi->isAddrTied()) {
+ Address addr;
+ // If one piece is address tied, the other must be as well, and they must fit together as contiguous whole
+ if (!SplitVarnode::isAddrTiedContiguous(reslo, reshi, addr))
+ return false;
+ }
return true;
}
return false;
diff --git a/Ghidra/Features/Decompiler/src/decompile/datatests/partialunion.xml b/Ghidra/Features/Decompiler/src/decompile/datatests/partialunion.xml
index 489cba0888..55c9e55e7f 100644
--- a/Ghidra/Features/Decompiler/src/decompile/datatests/partialunion.xml
+++ b/Ghidra/Features/Decompiler/src/decompile/datatests/partialunion.xml
@@ -33,7 +33,7 @@
dec
print C
lo fu partial1
- map unionfacet structunion 1 r0x1006ee 20603f6a8a0b89
+ map unionfacet structunion 1 r0x1006ee 10603f2c20ffa6
dec
print C
quit