File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
cpp/ql/src/semmle/code/cpp/ir/internal Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,12 @@ predicate hasBooleanType(int byteSize) {
5555private predicate isSigned ( IntegralOrEnumType type ) {
5656 type .( IntegralType ) .isSigned ( ) or
5757 exists ( Enum enumType |
58+ // If the enum has an explicit underlying type, we'll determine signedness from that. If not,
59+ // we'll assume unsigned. The actual rules for the implicit underlying type of an enum vary
60+ // between compilers, so we'll need an extractor change to get this 100% right. Until then,
61+ // unsigned is a reasonable default.
5862 enumType = type .getUnspecifiedType ( ) and
59- (
60- enumType .getExplicitUnderlyingType ( ) .getUnspecifiedType ( ) .( IntegralType ) .isSigned ( ) or
61- not exists ( enumType .getExplicitUnderlyingType ( ) ) // Assume signed.
62- )
63+ enumType .getExplicitUnderlyingType ( ) .getUnspecifiedType ( ) .( IntegralType ) .isSigned ( )
6364 )
6465}
6566
You can’t perform that action at this time.
0 commit comments