packages feed

dhscanner-bitcode 1.0.4 → 1.0.5

raw patch · 2 files changed

+19/−10 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Bitcode: UnresolvedRef :: UnresolvedRefContent -> InstructionContent
+ Bitcode: UnresolvedRefContent :: Variable -> Variable -> Location -> UnresolvedRefContent
+ Bitcode: [unresolvedRefLocation] :: UnresolvedRefContent -> Location
+ Bitcode: [unresolvedRefOutput] :: UnresolvedRefContent -> Variable
+ Bitcode: [unresolvedRef] :: UnresolvedRefContent -> Variable
+ Bitcode: data UnresolvedRefContent
+ Bitcode: instance Data.Aeson.Types.FromJSON.FromJSON Bitcode.UnresolvedRefContent
+ Bitcode: instance Data.Aeson.Types.ToJSON.ToJSON Bitcode.UnresolvedRefContent
+ Bitcode: instance GHC.Classes.Eq Bitcode.UnresolvedRefContent
+ Bitcode: instance GHC.Classes.Ord Bitcode.UnresolvedRefContent
+ Bitcode: instance GHC.Generics.Generic Bitcode.UnresolvedRefContent
+ Bitcode: instance GHC.Show.Show Bitcode.UnresolvedRefContent

Files

dhscanner-bitcode.cabal view
@@ -20,7 +20,7 @@     in mind. The commands resemble an abstract RISC-style assembley, motivated by keeping
     later-phases analyses as simple as possible.
 
-version:            1.0.4
+version:            1.0.5
 license:            GPL-3.0-only
 license-file:       LICENSE
 author:             OrenGitHub
src/Bitcode.hs view
@@ -4,12 +4,14 @@ -- are all synonyms for:
 --
 --     * a data structure able to represent code originating from /multiple/ programming languages.
+--     * minimal instruction set, similar in spirit to [RISC](https://en.wikipedia.org/wiki/Reduced_instruction_set_computer) architectures
+--     * unlike /actual/ assembly, it has an /infinite/ number of temporaries ( instead of registers )
 --
 -- * Its main purpose is to serve as the:
 --
 --     * second step for /static code analysis/ 
 --     * part of the [dhscanner](https://github.com/OrenGitHub/dhscanner) framework for
---       CI\/CD container security checks 🔒 and
+--       static analysis performing security checks 🔒 and
 --       [PII](https://en.wikipedia.org/wiki/Personal_data) leaks detection 🪪
 --
 -- * As part of the [dhscanner](https://github.com/OrenGitHub/dhscanner) framework:
@@ -19,13 +21,11 @@ --
 -- * Typical flow:
 --
---     * the 'Asts' (collection of all 'Ast' objects from some code base) are sent for code generation
+--     * Abstract syntax trees (ASTs) are scanned
 --
---         * received through REST API as a JSON http request
 --         * 'Callable' entities are identified
 --         * each 'Callable' is associated with its control flow graph ('Cfg')
---
---     * the collection of all 'Callables' is returned
+--         * control flow graphs are directed, connecting bitcode instructions
 --
 -- * Non Haskell parogrammers note:
 --
@@ -67,8 +67,7 @@      deriving ( Show, Eq, Generic, ToJSON, FromJSON, Ord )
 
 -- |
--- A minimal instruction set for translating cloud native programming languages and
--- enabling easier static analysis
+-- A minimal instruction set for translating common programming languages
 data InstructionContent
    = Nop
    | Call CallContent
@@ -83,6 +82,7 @@    | ParamDecl ParamDeclContent
    | FieldRead FieldReadContent
    | FieldWrite FieldWriteContent
+   | UnresolvedRef UnresolvedRefContent -- ^ @since 1.0.5
    | SubscriptRead SubscriptReadContent
    | SubscriptWrite SubscriptWriteContent
    deriving ( Show, Eq, Generic, ToJSON, FromJSON, Ord )
@@ -110,7 +110,7 @@    = ArgContent
      {
          argVariableFqn :: Fqn,
-         argVariableSerialIdx :: Word,
+         argVariableSerialIdx :: Word, -- ^ zero-based
          -- location is indicative to the call
          -- this arg was generated for
          argVariableMyAwesomeCallContext :: Location
@@ -121,7 +121,7 @@    = ParamVariable
      {
          paramVariableFqn :: Fqn,
-         paramVariableSerialIdx :: Word,
+         paramVariableSerialIdx :: Word, -- ^ zero-based
          paramVariableToken :: Token.ParamName
      }
      deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON )
@@ -165,6 +165,15 @@          callee :: Variable,
          args :: [ Variable ],
          callLocation :: Location
+     }
+     deriving ( Show, Eq, Generic, ToJSON, FromJSON, Ord )
+
+data UnresolvedRefContent
+   = UnresolvedRefContent
+     {
+         unresolvedRefOutput :: Variable,
+         unresolvedRef :: Variable,
+         unresolvedRefLocation :: Location
      }
      deriving ( Show, Eq, Generic, ToJSON, FromJSON, Ord )