aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 2766143c..8f796bb2 100644
--- a/compile.c
+++ b/compile.c
@@ -31,6 +31,11 @@ static bool promote(env_t *env, CORD *code, type_t *actual, type_t *needed)
if (!can_promote(actual, needed))
return false;
+ if (actual->tag == IntType && needed->tag == IntType && Match(needed, IntType)->bits == 0) {
+ *code = CORD_all("I(", *code, ")");
+ return true;
+ }
+
if (actual->tag == IntType || actual->tag == NumType)
return true;