mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
GP-1 Disable replace action for BadDataType
This commit is contained in:
parent
f250cfeac4
commit
3f638e22b4
1 changed files with 12 additions and 4 deletions
|
@ -4,9 +4,9 @@
|
|||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -67,10 +67,18 @@ public class ReplaceDataTypeAction extends DockingAction {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!(node instanceof DataTypeNode)) {
|
||||
if (!(node instanceof DataTypeNode dtNode)) {
|
||||
return false;
|
||||
}
|
||||
return node.isModifiable();
|
||||
if (!dtNode.isModifiable()) {
|
||||
return false;
|
||||
}
|
||||
if (dtNode.getDataType() instanceof BadDataType) {
|
||||
// Although BAD datatype should not appear in tree, if it does replace is
|
||||
// not supported. Delete should be used instead.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private DataTypeTreeNode getSelectedDataTypeTreeNode(ActionContext context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue