diff --git a/chapi-ast-c/src/main/kotlin/chapi/ast/cast/CFullIdentListener.kt b/chapi-ast-c/src/main/kotlin/chapi/ast/cast/CFullIdentListener.kt index 4e01a4ab..2ef2ff7e 100644 --- a/chapi-ast-c/src/main/kotlin/chapi/ast/cast/CFullIdentListener.kt +++ b/chapi-ast-c/src/main/kotlin/chapi/ast/cast/CFullIdentListener.kt @@ -173,8 +173,8 @@ open class CFullIdentListener(fileName: String) : CAstBaseListener() { // handle for a pointer val firstParameter = currentFunction.Parameters[0] if (firstParameter.TypeType.endsWith('*')) { - val pointerIndex = firstParameter.TypeType.length - 1 - val baseType = firstParameter.TypeType.substring(0, pointerIndex) + val baseType = firstParameter.TypeType.removeSuffix("*") + structMap.getOrPut(baseType) { CodeDataStruct(NodeName = baseType) }.let {