projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d92f81
)
If ghci runs out of labels, panic
author
Ian Lynagh
<igloo@earth.li>
Sat, 1 Aug 2009 13:28:29 +0000
(13:28 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Sat, 1 Aug 2009 13:28:29 +0000
(13:28 +0000)
compiler/ghci/ByteCodeGen.lhs
patch
|
blob
|
history
diff --git
a/compiler/ghci/ByteCodeGen.lhs
b/compiler/ghci/ByteCodeGen.lhs
index
4ec8043
..
d92e7f8
100644
(file)
--- a/
compiler/ghci/ByteCodeGen.lhs
+++ b/
compiler/ghci/ByteCodeGen.lhs
@@
-1534,7
+1534,10
@@
recordItblMallocBc a
getLabelBc :: BcM Word16
getLabelBc
- = BcM $ \st -> return (st{nextlabel = 1 + nextlabel st}, nextlabel st)
+ = BcM $ \st -> do let nl = nextlabel st
+ when (nl == maxBound) $
+ panic "getLabelBc: Ran out of labels"
+ return (st{nextlabel = nl + 1}, nl)
getLabelsBc :: Word16 -> BcM [Word16]
getLabelsBc n