diff options
author | Son Ho | 2022-02-22 17:55:46 +0100 |
---|---|---|
committer | Son Ho | 2022-02-22 17:55:46 +0100 |
commit | 279d7ef00d5322f8b04b729c0c6e32f03789a387 (patch) | |
tree | ddf31374c504adc00f7acc5b33ed3c6f3d1b1527 /src/CfimAst.ml | |
parent | 1fa2f2812215da74cb793dc63d621a8d15c55523 (diff) |
Add support for "fused" match branches
Diffstat (limited to 'src/CfimAst.ml')
-rw-r--r-- | src/CfimAst.ml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/CfimAst.ml b/src/CfimAst.ml index a06dfc90..6716c793 100644 --- a/src/CfimAst.ml +++ b/src/CfimAst.ml @@ -142,10 +142,12 @@ type statement = and switch_targets = | If of statement * statement (** Gives the "if" and "else" blocks *) - | SwitchInt of integer_type * (scalar_value * statement) list * statement + | SwitchInt of integer_type * (scalar_value list * statement) list * statement (** The targets for a switch over an integer are: - - the list `(matched value, statement to execute)` - - the "otherwise" statement. + - the list `(matched values, statement to execute)` + We need a list for the matched values in case we do something like this: + `switch n { 0 | 1 => ..., _ => ... } + - the "otherwise" statement Also note that we precise the type of the integer (uint32, int64, etc.) which we switch on. *) [@@deriving |