binPAC : segfault in "let var : int8" when no initialisation value

Description

In binPAC grammar, "let" expression takes an optional initialization value :
("optinit" in pac_parse.yy)

There are three ways to build a "let" variable :

let v : int8 = 0; # OK for binPAC compiler
let w = 0; # OK for binPAC compiler
let x : int8; # KO, binPAC segmentation fault

If no initialization value is provided, null pointer is returned by the parser and expr_ attribute in pac_let.h is initialized to null pointer.
Code in pac_let.cc does not check for cases where expr_ is null; thus it crashes.

I started to write a patch but I don't know if the binPAC language is supposed to default-initialized all of its variables, or not ?

Note: I suppose &let derived attributes have the very same initialization problem ? To be checked.

Environment

None

Assignee

Unassigned

Reporter

Fran├žois

Labels

External issue ID

None

Components

Affects versions

Priority

Normal
Configure