Use stripTopLevelSpecifiers() to get the allocated element type for malloc().

This commit is contained in:
Cornelius Riemenschneider
2020-04-27 12:45:03 +02:00
parent 92e8604fa1
commit 3f7d68178c
2 changed files with 3 additions and 2 deletions

View File

@@ -343,7 +343,8 @@ class CallAllocationExpr extends AllocationExpr, FunctionCall {
override Expr getReallocPtr() { result = getArgument(target.getReallocPtrArg()) }
override Type getAllocatedElementType() {
result = this.getFullyConverted().getUnderlyingType().(PointerType).getBaseType() and
result =
this.getFullyConverted().getType().stripTopLevelSpecifiers().(PointerType).getBaseType() and
not result instanceof VoidType
}