mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-10 06:02:09 +00:00
GP-4926 Don't remove jump reference to next instruction, unless the
instruction flowType says it has a fallthrough
This commit is contained in:
parent
9a04ea643a
commit
63a138dd12
@ -2964,8 +2964,13 @@ public class CodeManager implements ErrorHandler, ManagerDB {
|
||||
if (flowType == null) {
|
||||
flowType = RefType.INVALID;
|
||||
}
|
||||
// Only remove jump reference if the function flowtype says it has a fallthrough
|
||||
// Removing the branch to next address if instruction has no fallthrough causes
|
||||
// flow following issues, for example creating a function body.
|
||||
boolean isFallthrough =
|
||||
(flowType.isJump() && flowAddr.equals(inst.getMaxAddress().next()));
|
||||
(flowType.isJump() && flowAddr.equals(inst.getMaxAddress().next())) &&
|
||||
inst.hasFallthrough();
|
||||
|
||||
if (!isFallthrough) {
|
||||
mnemonicPrimaryRef = addDefaultMemoryReferenceIfMissing(inst,
|
||||
Reference.MNEMONIC, flowAddr, flowType, oldRefList, mnemonicPrimaryRef);
|
||||
|
Loading…
Reference in New Issue
Block a user