aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index cbfe5ff..b9938ea 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -1082,7 +1082,9 @@ ST_FUNC int gv(int rc)
} else
type.t = VT_INT;
if((vtop->type.t & VT_UNSIGNED) ||
- (vtop->type.t & VT_BTYPE) == VT_BOOL)
+ (vtop->type.t & VT_BTYPE) == VT_BOOL ||
+ (((vtop->type.t & VT_BTYPE) == VT_ENUM) &&
+ vtop->type.ref->a.unsigned_enum))
type.t |= VT_UNSIGNED;
gen_cast(&type);
/* generate shifts */