Skip to content

Commit d3e34f9

Browse files
committed
GP-5216 GenericCallingConvention fix
1 parent 87666d8 commit d3e34f9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/GenericCallingConvention.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -81,10 +81,16 @@ public String toString() {
8181
/**
8282
* Returns the GenericCallingConvention corresponding to the specified
8383
* type string or unknown if name is not defined.
84-
* @param callingConvention calling convention declaration name (e.g., "__stdcall")
84+
* @param callingConvention calling convention declaration name (e.g., "__stdcall").
85+
* Enum name is also allowed for backward compatibility.
8586
* @return GenericCallingConvention or {@link #unknown} if not found.
8687
*/
8788
public static GenericCallingConvention getGenericCallingConvention(String callingConvention) {
89+
for (GenericCallingConvention value : GenericCallingConvention.values()) {
90+
if (value.getDeclarationName().equalsIgnoreCase(callingConvention)) {
91+
return value;
92+
}
93+
}
8894
for (GenericCallingConvention value : GenericCallingConvention.values()) {
8995
if (value.name().equalsIgnoreCase(callingConvention)) {
9096
return value;

0 commit comments

Comments
 (0)