GP-5008 - Fixed exception seen in Version Tracking

This commit is contained in:
dragonmacher 2024-10-10 12:13:06 -04:00
parent 9108198ba7
commit 9579d9e145
2 changed files with 10 additions and 5 deletions

View File

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -325,13 +325,17 @@ public class DataGraph {
private void removeInEdge(DataVertex node, int inEdge) { private void removeInEdge(DataVertex node, int inEdge) {
DataVertex inNode = node.sources.get(inEdge); DataVertex inNode = node.sources.get(inEdge);
int outEdge; int outEdge;
for (outEdge = 0; outEdge < inNode.sinks.size(); ++outEdge) { for (outEdge = 0; outEdge < inNode.sinks.size(); outEdge++) {
if (inNode.sinks.get(outEdge) == node) { if (inNode.sinks.get(outEdge) == node) {
break; break;
} }
} }
node.sources.remove(inEdge); node.sources.remove(inEdge);
inNode.sinks.remove(outEdge);
int n = inNode.sinks.size();
if (n != 0) {
inNode.sinks.remove(outEdge);
}
} }
/** /**

View File

@ -29,6 +29,7 @@ import ghidra.features.base.codecompare.model.FunctionComparisonModelListener;
import ghidra.features.base.codecompare.panel.CodeComparisonPanel; import ghidra.features.base.codecompare.panel.CodeComparisonPanel;
import ghidra.features.base.codecompare.panel.FunctionComparisonPanel; import ghidra.features.base.codecompare.panel.FunctionComparisonPanel;
import ghidra.framework.plugintool.PluginTool; import ghidra.framework.plugintool.PluginTool;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Function; import ghidra.program.model.listing.Function;
import ghidra.util.datastruct.Duo; import ghidra.util.datastruct.Duo;
import ghidra.util.datastruct.Duo.Side; import ghidra.util.datastruct.Duo.Side;
@ -228,7 +229,7 @@ public class MultiFunctionComparisonPanel extends FunctionComparisonPanel
String functionName = f.getName(); String functionName = f.getName();
String functionPathToProgram = f.getProgram().getDomainFile().getPathname(); String functionPathToProgram = f.getProgram().getDomainFile().getPathname();
String functionAddress = f.getBody().getMinAddress().toString(); Address functionAddress = f.getEntryPoint();
String text = functionName + "@" + functionAddress + " (" + functionPathToProgram + ")"; String text = functionName + "@" + functionAddress + " (" + functionPathToProgram + ")";
return super.getListCellRendererComponent(list, text, index, isSelected, cellHasFocus); return super.getListCellRendererComponent(list, text, index, isSelected, cellHasFocus);