summaryrefslogtreecommitdiff
path: root/backend/CMtypecheck.ml
diff options
context:
space:
mode:
Diffstat (limited to 'backend/CMtypecheck.ml')
-rw-r--r--backend/CMtypecheck.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/CMtypecheck.ml b/backend/CMtypecheck.ml
index 02c3f21..aacbf86 100644
--- a/backend/CMtypecheck.ml
+++ b/backend/CMtypecheck.ml
@@ -313,8 +313,8 @@ let rec type_stmt env blk ret s =
| Sexit n ->
if Nat.to_int n >= blk then
raise (Error (sprintf "Bad exit(%d)\n" (Nat.to_int n)))
- | Sswitch(e, cases, deflt) ->
- unify (type_expr env [] e) tint
+ | Sswitch(islong, e, cases, deflt) ->
+ unify (type_expr env [] e) (if islong then tlong else tint)
| Sreturn None ->
begin match ret with
| None -> ()