Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] parsing code with arrays



Hello,

youssef hassoun a ?crit :
> In trying to parse a program involving array variables with:
>   let f = fst (Frontc.parse <code file with array variables>) in
>    .....
> 
> I get the following error message:
> 
> Fatal error: exception Qstack.Make(D).Empty
> 
> No such error occur when parsing code with NO arrays. It seems as if 
> some initialisations are necessary before the Frama-c Cil-parser is in
> a position to parse code with arrays. It this true?

That's true.

1) Do never call the Frama-C parser yourself. Just call Ast.get (more 
generally, one of the functions of the module Ast).

2) You don't give the whole context of your plug-in, but this exception 
is usually raised when your code is executed too early. See Frama-C 
Plug-in Development Guide, Section 4.13 "Initialization Steps". Quoting:
"As a general rule, plug-in routines must never be executed at link 
time. Any useful code, be it for registration, configuration or C-code 
analysis, should be registered as function hooks to be executed at a 
proper time during the Frama-C boot process.

Regards,
Julien Signoles