Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jberryman
GHC
Commits
ba123ed2
Commit
ba123ed2
authored
Feb 13, 2001
by
sewardj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2001-02-13 17:48:25 by sewardj]
Improve detection and rejection of unboxed tuples.
parent
c1834c5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
ghc/compiler/ghci/ByteCodeGen.lhs
ghc/compiler/ghci/ByteCodeGen.lhs
+13
-4
No files found.
ghc/compiler/ghci/ByteCodeGen.lhs
View file @
ba123ed2
...
...
@@ -39,6 +39,7 @@ import CmdLineOpts ( DynFlags, DynFlag(..) )
import ErrUtils ( showPass, dumpIfSet_dyn )
import Unique ( mkPseudoUnique3 )
import FastString ( FastString(..) )
import Panic ( GhcException(..) )
import PprType ( pprType )
import ByteCodeInstr ( BCInstr(..), ProtoBCO(..), nameOfProtoBCO, bciStackUse )
import ByteCodeItbls ( ItblEnv, mkITbls )
...
...
@@ -50,6 +51,7 @@ import List ( intersperse, sortBy )
import Foreign ( Ptr(..), mallocBytes )
import Addr ( Addr(..), addrToInt, writeCharOffAddr )
import CTypes ( CInt )
import Exception ( throwDyn )
import PrelBase ( Int(..) )
import PrelGHC ( ByteArray# )
...
...
@@ -373,8 +375,12 @@ schemeE d s p (fvs, AnnCase scrut bndr alts)
schemeE d' s p' rhs `thenBc` \ rhs_code ->
returnBc (my_discr alt, rhs_code)
my_discr (DEFAULT, binds, rhs) = NoDiscr
my_discr (DataAlt dc, binds, rhs) = DiscrP (dataConTag dc - fIRST_TAG)
my_discr (DEFAULT, binds, rhs) = NoDiscr
my_discr (DataAlt dc, binds, rhs)
| isUnboxedTupleCon dc
= unboxedTupleException
| otherwise
= DiscrP (dataConTag dc - fIRST_TAG)
my_discr (LitAlt l, binds, rhs)
= case l of MachInt i -> DiscrI (fromInteger i)
MachFloat r -> DiscrF (fromRational r)
...
...
@@ -442,8 +448,7 @@ schemeT d s p app
-- Cases 2 and 3
| otherwise
= if is_con_call && isUnboxedTupleCon con
then pprPanic "Bytecode generator can't handle unboxed tuple constructor"
(ppr con)
then unboxedTupleException
else code
where
...
...
@@ -872,6 +877,10 @@ taggedIdSizeW, untaggedIdSizeW :: Id -> Int
taggedIdSizeW = taggedSizeW . typePrimRep . idType
untaggedIdSizeW = untaggedSizeW . typePrimRep . idType
unboxedTupleException :: a
unboxedTupleException
= throwDyn (Panic "bytecode generator can't handle unboxed tuples")
\end{code}
%************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment