[frama-clang] Crash parsing compound literals
Steps to reproduce the issue
The following is a valid C++ code that initialises variables i
and j
using compound literals.
typedef struct A_ { int a; } A;
struct B { int b; };
struct C { A aa; struct B bb; };
struct B i{0};
struct C j{{0}, i};
Expected behaviour
frama-c struct_fail.cpp
should parse the file.
Actual behaviour
$ frama-c struct_fail.cpp
[kernel] Parsing struct_fail.cpp (external front-end)
Now output intermediate result
[fclang] struct_fail.cpp:6: Failure: Compound init on a scalar type
[kernel] Current source was: struct_fail.cpp:6
The full backtrace is:
Raised at Log.finally_raise in file "src/kernel_services/plugin_entry_points/log.ml" (inlined), line 546, characters 24-31
Called from Log.Register.fatal in file "src/kernel_services/plugin_entry_points/log.ml", line 1115, characters 17-55
Called from Log.logwithfinal.(fun) in file "src/kernel_services/plugin_entry_points/log.ml", line 539, characters 9-23
Re-raised at Log.logwithfinal.(fun) in file "src/kernel_services/plugin_entry_points/log.ml", line 542, characters 9-16
Called from Log.Register.fatal in file "src/kernel_services/plugin_entry_points/log.ml", line 1115, characters 4-125
Called from Convert.mk_compound_init.aux.aux_struct in file "convert.ml", line 558, characters 24-44
Called from Convert.mk_compound_init in file "convert.ml", line 563, characters 19-37
Called from Convert.convert_global in file "convert.ml", line 4028, characters 29-62
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
Called from Convert.convert_ast in file "convert.ml", line 4120, characters 12-76
Called from Frama_Clang_register.parse_cxx in file "frama_Clang_register.ml", line 175, characters 13-36
Called from File.parse_cabs in file "src/kernel_services/ast_queries/file.ml", line 621, characters 6-49
Called from File.to_cil_cabs in file "src/kernel_services/ast_queries/file.ml", line 630, characters 14-38
Called from File.files_to_cabs_cil.(fun) in file "src/kernel_services/ast_queries/file.ml", line 693, characters 46-72
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
Called from File.files_to_cabs_cil in file "src/kernel_services/ast_queries/file.ml", line 693, characters 17-89
Called from File.prepare_from_c_files in file "src/kernel_services/ast_queries/file.ml", line 1784, characters 24-60
Called from File.init_from_cmdline in file "src/kernel_services/ast_queries/file.ml", line 1861, characters 4-27
Called from Ast.force_compute in file "src/kernel_services/ast_data/ast.ml", line 110, characters 2-28
Called from Ast.compute in file "src/kernel_services/ast_data/ast.ml", line 118, characters 53-71
Called from Boot.play_analysis in file "src/kernel_internals/runtime/boot.ml", line 29, characters 6-20
Called from Cmdline.play_in_toplevel_one_shot in file "src/kernel_services/cmdline_parameters/cmdline.ml", line 846, characters 2-9
Called from Cmdline.play_in_toplevel in file "src/kernel_services/cmdline_parameters/cmdline.ml", line 876, characters 18-64
Called from Cmdline.catch_toplevel_run in file "src/kernel_services/cmdline_parameters/cmdline.ml", line 235, characters 4-8
Plug-in fclang aborted: internal error.
Please report as 'crash' at https://git.frama-c.com/pub/frama-c/issues
Your Frama-C version is 23.1 (Vanadium).
Note that a version and a backtrace alone often do not contain enough
information to understand the bug. Guidelines for reporting bugs are at:
https://git.frama-c.com/pub/frama-c/-/wikis/Guidelines-for-reporting-bugs
Contextual information
- Frama-C installation mode: Opam
- Frama-C version: 23.1 (Vanadium)
- Plug-in used: frama-clang-0.0.11
- OS name: macOS
- OS version: Big Sur 11.5.2