CPP: Replace stripTopLevelSpecifiers to emulate old behaviour.

This commit is contained in:
Geoffrey White
2018-09-11 15:32:58 +01:00
parent 89c56486b5
commit 580471ab1d

View File

@@ -19,6 +19,15 @@ private Type getAFormatterWideTypeOrDefault() {
)
}
private Type stripTopLevelSpecifiersOnly(Type t) {
(
result = stripTopLevelSpecifiersOnly(t.(SpecifiedType).getBaseType())
) or (
result = t and
not t instanceof SpecifiedType
)
}
/**
* A standard library function that uses a `printf`-like formatting string.
*/
@@ -37,8 +46,8 @@ abstract class FormattingFunction extends Function {
* `char` or `wchar_t`.
*/
Type getDefaultCharType() {
result = getParameter(getFormatParameterIndex()).getType().
getUnderlyingType().(PointerType).getBaseType().stripTopLevelSpecifiers()
result = stripTopLevelSpecifiersOnly(getParameter(getFormatParameterIndex()).getType().
getUnderlyingType().(PointerType).getBaseType())
}
/**