diff --git a/Python/compile.c b/Python/compile.c index 29252bbe765d09..ec47af151f9958 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2180,7 +2180,7 @@ compiler_type_params(struct compiler *c, asdl_type_param_seq *type_params) seen_default = true; expr_ty default_ = typeparam->v.TypeVar.default_value; if (compiler_type_param_bound_or_default(c, default_, typeparam->v.TypeVar.name, - (void *)(typeparam + 1), false) < 0) { + (void *)((uintptr_t)typeparam + 1), false) < 0) { return ERROR; } ADDOP_I(c, loc, CALL_INTRINSIC_2, INTRINSIC_SET_TYPEPARAM_DEFAULT); diff --git a/Python/symtable.c b/Python/symtable.c index 94a3dc9d839611..2ec21a2d376da2 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -2317,7 +2317,7 @@ symtable_visit_type_param(struct symtable *st, type_param_ty tp) VISIT_QUIT(st, 0); } if (!symtable_visit_type_param_bound_or_default(st, tp->v.TypeVar.default_value, tp->v.TypeVar.name, - (void *)(tp + 1))) { + (void *)((uintptr_t)tp + 1))) { VISIT_QUIT(st, 0); } break;