summaryrefslogtreecommitdiff
path: root/utils/genapply
diff options
context:
space:
mode:
authorwolfgang.thaller@gmx.net <unknown>2006-10-22 16:05:07 +0000
committerwolfgang.thaller@gmx.net <unknown>2006-10-22 16:05:07 +0000
commit4f6f4a294f00d559b4f024255d11eb1da9bfe036 (patch)
tree596def24d632826db1824481cf4fceabbb6c23de /utils/genapply
parent6c5705e398947a3b74a3f9b7cfb3dd93ca12b8e0 (diff)
downloadhaskell-4f6f4a294f00d559b4f024255d11eb1da9bfe036.tar.gz
Cast switch scrutinees to W_ in AutoApply.cmm
... and make CmmLint check for this problem. This doesn't matter for -fvia-C, but passing a halfword to a switch will make the NCG generate crashing code.
Diffstat (limited to 'utils/genapply')
-rw-r--r--utils/genapply/GenApply.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/genapply/GenApply.hs b/utils/genapply/GenApply.hs
index cdde66fa78..68277030ac 100644
--- a/utils/genapply/GenApply.hs
+++ b/utils/genapply/GenApply.hs
@@ -414,7 +414,7 @@ genApply regstatus args =
-- if fast == 1:
-- print " goto *lbls[info->type];";
-- else:
- text "switch [INVALID_OBJECT .. N_CLOSURE_TYPES] (%INFO_TYPE(%STD_INFO(info))) {",
+ text "switch [INVALID_OBJECT .. N_CLOSURE_TYPES] (TO_W_(%INFO_TYPE(%STD_INFO(info)))) {",
nest 4 (vcat [
-- if fast == 1:
@@ -540,7 +540,7 @@ genApplyFast regstatus args =
text "W_ info;",
text "W_ arity;",
text "info = %GET_STD_INFO(R1);",
- text "switch [INVALID_OBJECT .. N_CLOSURE_TYPES] (%INFO_TYPE(info)) {",
+ text "switch [INVALID_OBJECT .. N_CLOSURE_TYPES] (TO_W_(%INFO_TYPE(info))) {",
nest 4 (vcat [
text "case FUN,",
text " FUN_1_0,",