Skip to content

Commit

Permalink
Only allow global nullable pointers to be stored in structures
Browse files Browse the repository at this point in the history
Do exactly what doc says. Avoid situations like GaloisInc#89
  • Loading branch information
cblp authored and sorki committed Dec 17, 2023
1 parent 316893b commit 65730b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ivory/src/Ivory/Language/Ref.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
Expand Down Expand Up @@ -102,5 +103,5 @@ instance IvoryStore Sint32
instance IvoryStore Sint64

-- Only allow global nullable pointers to be stored in structures.
instance (KnownConstancy c, IvoryArea a) =>
IvoryStore (Pointer 'Nullable c 'Global a)
instance (KnownConstancy c, IvoryArea a, n ~ 'Nullable, s ~ 'Global) =>
IvoryStore (Pointer n c s a)

0 comments on commit 65730b9

Please sign in to comment.