mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Save the head of the type for the return value.
This commit is contained in:
parent
cf3d839940
commit
c7c666408a
1 changed files with 7 additions and 2 deletions
|
@ -232,6 +232,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
|
|||
|
||||
// Parse the string.
|
||||
GDBType gdbType = gdbTypeParser.parse(typename);
|
||||
Type headType = null;
|
||||
Type type = null;
|
||||
|
||||
for (Type aType = null; gdbType != null; type = aType) {
|
||||
|
@ -259,10 +260,14 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
|
|||
if (type instanceof DerivedType) {
|
||||
((DerivedType)type).setComponentType(aType);
|
||||
}
|
||||
// Save the head to returning it.
|
||||
if (headType == null) {
|
||||
headType = aType;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != null) {
|
||||
return type;
|
||||
if (headType != null) {
|
||||
return headType;
|
||||
}
|
||||
throw new CDIException("Unknown type");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue