mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Merge remote-tracking branch 'origin/patch'
Conflicts: Ghidra/Features/Decompiler/src/decompile/cpp/funcdata_varnode.cc
This commit is contained in:
commit
e2ae03d1b9
3 changed files with 12 additions and 7 deletions
|
@ -1222,12 +1222,11 @@ bool Funcdata::attemptDynamicMapping(SymbolEntry *entry,DynamicHash &dhash)
|
||||||
}
|
}
|
||||||
Varnode *vn = dhash.findVarnode(this,entry->getFirstUseAddress(),entry->getHash());
|
Varnode *vn = dhash.findVarnode(this,entry->getFirstUseAddress(),entry->getHash());
|
||||||
if (vn == (Varnode *)0) return false;
|
if (vn == (Varnode *)0) return false;
|
||||||
|
if (vn->getSymbolEntry() != (SymbolEntry *)0) return false; // Varnode is already labeled
|
||||||
if (category == Symbol::equate) { // Is this an equate symbol
|
if (category == Symbol::equate) { // Is this an equate symbol
|
||||||
if (vn->mapentry != entry) { // Check we haven't marked this before
|
|
||||||
vn->setSymbolEntry(entry);
|
vn->setSymbolEntry(entry);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (entry->getSize() == vn->getSize()) {
|
else if (entry->getSize() == vn->getSize()) {
|
||||||
if (vn->setSymbolProperties(entry))
|
if (vn->setSymbolProperties(entry))
|
||||||
return true;
|
return true;
|
||||||
|
@ -1254,7 +1253,7 @@ bool Funcdata::attemptDynamicMappingLate(SymbolEntry *entry,DynamicHash &dhash)
|
||||||
Varnode *vn = dhash.findVarnode(this,entry->getFirstUseAddress(),entry->getHash());
|
Varnode *vn = dhash.findVarnode(this,entry->getFirstUseAddress(),entry->getHash());
|
||||||
if (vn == (Varnode *)0)
|
if (vn == (Varnode *)0)
|
||||||
return false;
|
return false;
|
||||||
if (vn->getSymbolEntry() == entry) return false; // Already applied it
|
if (vn->getSymbolEntry() != (SymbolEntry *)0) return false; // Symbol already applied
|
||||||
if (sym->getCategory() == Symbol::equate) { // Equate symbol does not depend on size
|
if (sym->getCategory() == Symbol::equate) { // Equate symbol does not depend on size
|
||||||
vn->setSymbolEntry(entry);
|
vn->setSymbolEntry(entry);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -637,7 +637,13 @@ public class SpecExtension {
|
||||||
}
|
}
|
||||||
cspecValidator.verify(res.optionName, document);
|
cspecValidator.verify(res.optionName, document);
|
||||||
checkExtension(res);
|
checkExtension(res);
|
||||||
parseExtension(res.optionName, document, program.getCompilerSpec(), false);
|
if (!(program.getCompilerSpec() instanceof BasicCompilerSpec)) {
|
||||||
|
throw new SleighException(
|
||||||
|
"Can only test specification extensions against SLEIGH program");
|
||||||
|
}
|
||||||
|
BasicCompilerSpec cSpecCopy =
|
||||||
|
new BasicCompilerSpec((BasicCompilerSpec) program.getCompilerSpec());
|
||||||
|
parseExtension(res.optionName, document, cSpecCopy, false);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class BasicCompilerSpec implements CompilerSpec {
|
||||||
* spec from Language.
|
* spec from Language.
|
||||||
* @param op2 is the spec to clone
|
* @param op2 is the spec to clone
|
||||||
*/
|
*/
|
||||||
protected BasicCompilerSpec(BasicCompilerSpec op2) {
|
public BasicCompilerSpec(BasicCompilerSpec op2) {
|
||||||
language = op2.language;
|
language = op2.language;
|
||||||
description = op2.description;
|
description = op2.description;
|
||||||
// PrototypeModel is immutable but the map may change, so callingConventionMap
|
// PrototypeModel is immutable but the map may change, so callingConventionMap
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue