Skip to content

Commit ee28fb6

Browse files
committed
Fixed handling of - between pointer and generic
1 parent d161c9e commit ee28fb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontends/types.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,10 +1018,10 @@ AST *CoerceOperatorTypes(AST *ast, AST *lefttype, AST *righttype)
10181018
}
10191019
return ast_type_unsigned_long;
10201020
}
1021-
if (IsPointerType(lefttype) && IsIntType(righttype)) {
1021+
if (IsPointerType(lefttype) && IsIntOrGenericType(righttype)) {
10221022
ast->right = ScalePointer(lefttype, forcepromote(righttype, ast->right));
10231023
return lefttype;
1024-
} else if (IsPointerType(righttype) && IsIntType(lefttype)) {
1024+
} else if (IsPointerType(righttype) && IsIntOrGenericType(lefttype)) {
10251025
ast->left = ScalePointer(righttype, forcepromote(lefttype, ast->left));
10261026
return righttype;
10271027
} else {

0 commit comments

Comments
 (0)