Switching to looking for explicit declaration of unsigned char, to avoid cases where unsigned char is the default char width for char.

This commit is contained in:
REDMOND\brodes
2024-09-30 11:02:43 -04:00
parent c4737c7fbb
commit 51e787b316

View File

@@ -37,7 +37,9 @@ Type getABaseType(Type t) {
class UnlikelyToBeAStringType extends Type {
UnlikelyToBeAStringType() {
exists(Type targ |
targ.(CharType).isUnsigned() or
// NOTE: not using CharType isUnsigned, but rather look for any explicitly declared unsigned
// char types. Assuming these are used for buffers, not strings.
targ.(CharType).getName().toLowerCase().matches(["unsigned%"]) or
targ.getName().toLowerCase().matches(["uint8_t", "%byte%"])
|
getABaseType(this) = targ