Hey,

On Tue, May 14, 2019 at 11:13:40PM +0200, Fernando Fernandez Mancera wrote:
[...]
> diff --git a/src/datatype.c b/src/datatype.c
> index 6aaf9ea..7e9ec5e 100644
> --- a/src/datatype.c
> +++ b/src/datatype.c
> @@ -297,11 +297,22 @@ static void verdict_type_print(const struct expr *expr, 
> struct output_ctx *octx)
>       }
>  }
>  
> +static struct error_record *verdict_type_parse(const struct expr *sym,
> +                                            struct expr **res)
> +{
> +     *res = constant_expr_alloc(&sym->location, &string_type,
> +                                BYTEORDER_HOST_ENDIAN,
> +                                (strlen(sym->identifier) + 1) * 
> BITS_PER_BYTE,
> +                                sym->identifier);
> +     return NULL;
> +}

One more thing: The above lacks error checking of any kind. I *think*
this is the place where one should make sure the symbol expression is
actually a string (but I'm not quite sure how you do that).

In any case, please try to exploit that variable support in the testcase
(or maybe a separate one), just to make sure we don't allow weird
things.

Thanks, Phil

Reply via email to