shithub: MicroHs

Download patch

ref: a32b2179cdb49a9c05bdb208d2f23c895d17e482
parent: 33992166b2dc3e2c4c9f48ec676dee0db2799b3e
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Mon Jan 22 14:27:36 EST 2024

Safer wordsize detection.

--- a/lib/Data/Integer_Type.hs
+++ b/lib/Data/Integer_Type.hs
@@ -15,8 +15,10 @@
 maxD =
   if _wordSize `primIntEQ` 64 then
     (2147483648::Int)  -- 2^31, this is used so multiplication of two digits doesn't overflow a 64 bit Int
-  else
+  else if _wordSize `primIntEQ` 32 then
     (32768::Int)       -- 2^15, this is used so multiplication of two digits doesn't overflow a 32 bit Int
+  else
+    primError "Integer: unsupported word size"
 
 -- Sadly, we also need a bunch of functions.
 
--