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
0bc6055b
Commit
0bc6055b
authored
Mar 02, 2012
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash caused by allowing duplicate *-modules in the context (#5904)
parent
085c7fe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
ghc/InteractiveUI.hs
ghc/InteractiveUI.hs
+13
-2
No files found.
ghc/InteractiveUI.hs
View file @
0bc6055b
...
...
@@ -1317,7 +1317,7 @@ setContextKeepingPackageModules keep_ctx trans_ctx = do
new_rem_ctx
<-
if
keep_ctx
then
return
rem_ctx
else
keepPackageImports
rem_ctx
setGHCiState
st
{
remembered_ctx
=
new_rem_ctx
,
transient_ctx
=
trans_ctx
}
transient_ctx
=
filterSubsumed
new_rem_ctx
trans_ctx
}
setGHCContextFromGHCiState
...
...
@@ -1668,7 +1668,10 @@ addII :: InteractiveImport -> GHCi ()
addII
iidecl
=
do
checkAdd
iidecl
modifyGHCiState
$
\
st
->
st
{
remembered_ctx
=
addNotSubsumed
iidecl
(
remembered_ctx
st
)
}
st
{
remembered_ctx
=
addNotSubsumed
iidecl
(
remembered_ctx
st
)
,
transient_ctx
=
filter
(
not
.
(
iidecl
`
iiSubsumes
`))
(
transient_ctx
st
)
}
-- -----------------------------------------------------------------------------
-- Validate a module that we want to add to the context
...
...
@@ -1759,8 +1762,16 @@ addNotSubsumed i is
|
any
(`
iiSubsumes
`
i
)
is
=
is
|
otherwise
=
i
:
filter
(
not
.
(
i
`
iiSubsumes
`))
is
-- | @filterSubsumed is js@ returns the elements of @js@ not subsumed
-- by any of @is@.
filterSubsumed
::
[
InteractiveImport
]
->
[
InteractiveImport
]
->
[
InteractiveImport
]
filterSubsumed
is
js
=
filter
(
\
j
->
not
(
any
(`
iiSubsumes
`
j
)
is
))
js
-- | Returns True if the left import subsumes the right one. Doesn't
-- need to be 100% accurate, conservatively returning False is fine.
-- (EXCEPT: (IIModule m) *must* subsume itself, otherwise a panic in
-- plusProv will ensue (#5904))
--
-- Note that an IIModule does not necessarily subsume an IIDecl,
-- because e.g. a module might export a name that is only available
...
...
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