Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-1589 - fixed decompiler action stack trace

dragonmacherb82f8631fe0f
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FindReferencesToDataTypeAction.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FindReferencesToDataTypeAction.java
index 2429792bff..b81a514126 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FindReferencesToDataTypeAction.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/FindReferencesToDataTypeAction.java
@@ -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.
@@ -56,16 +56,19 @@ public class FindReferencesToDataTypeAction extends AbstractFindReferencesDataTy
return tokenAtCursor.getText();
}
- if (dataType instanceof Enum) {
+ if (tokenAtCursor instanceof ClangVariableToken) {
+
+ if (dataType instanceof Enum) {
- // check for enum field
- ClangVariableToken vt = (ClangVariableToken) tokenAtCursor;
- String text = vt.getText();
- Enum e = (Enum) dataType;
- String[] names = e.getNames();
- for (String name : names) {
- if (name.equals(text)) {
- return name;
+ // check for enum field
+ ClangVariableToken vt = (ClangVariableToken) tokenAtCursor;
+ String text = vt.getText();
+ Enum e = (Enum) dataType;
+ String[] names = e.getNames();
+ for (String name : names) {
+ if (name.equals(text)) {
+ return name;
+ }
}
}
}