AdaCore / libadalang-tools

Libadalang-based tools
GNU General Public License v3.0
16 stars 14 forks source link

gnatpp: Program error when parsing unbounded array #5

Open LordAro opened 5 years ago

LordAro commented 5 years ago

The following spec file:

package bitvector is
   type t_bvstorage is array (Natural range <>) of Integer;
end bitvector;

results in:

Unhandled Exception raised
raised PROGRAM_ERROR : <UnconstrainedArrayIndices test.ads:2:31-2:47> encountered
[/home/cpigott/dev/libadalang-tools/bin/gnatpp]
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada at pp-actions.adb:4447
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template.Do_Subtree at pp-actions.adb:3184
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template at pp-actions.adb:3300
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Do_Others at pp-actions.adb:4034
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada at pp-actions.adb:4580
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template.Do_Subtree at pp-actions.adb:3184
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template at pp-actions.adb:3300
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Alt_Template at pp-actions.adb:2722
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Do_Type_Decl at pp-actions.adb:4308
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada at pp-actions.adb:4523
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Subtrees_To_Ada at pp-actions.adb:3054
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template.Do_Opt_Subtree_Or_List at pp-actions.adb:3160
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template.Do_Subtree at pp-actions.adb:3188
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template at pp-actions.adb:3300
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Do_Others at pp-actions.adb:4034
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada at pp-actions.adb:4580
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template.Do_Subtree at pp-actions.adb:3184
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template at pp-actions.adb:3300
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Do_Others at pp-actions.adb:4034
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada at pp-actions.adb:4580
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template.Do_Subtree at pp-actions.adb:3184
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Interpret_Template at pp-actions.adb:3300
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Do_Others at pp-actions.adb:4034
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada at pp-actions.adb:4580
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada.Do_Compilation_Unit at pp-actions.adb:3513
Pp.Actions.Tree_To_Ada_2.Subtree_To_Ada at pp-actions.adb:4451
Pp.Actions.Tree_To_Ada_2.Convert_Tree_To_Ada at pp-actions.adb:4599
Pp.Actions.Tree_To_Ada_2 at pp-actions.adb:4644
Pp.Actions.Format_Vector.Tree_To_Ada at pp-actions.adb:4710
Pp.Actions.Format_Vector at pp-actions.adb:4880
Pp.Actions.Per_File_Action at pp-actions.adb:5200
Utils.Tools.Process_File at utils-tools.adb:90
Utils.Drivers.Driver.Process_Files at utils-drivers.adb:121
Utils.Drivers.Driver at utils-drivers.adb:220
Pp.Main at pp-main.adb:20
Main at b__pp-main.adb:1706
[/lib/x86_64-linux-gnu/libc.so.6]
0x7fad73684b95
[/home/cpigott/dev/libadalang-tools/bin/gnatpp]
0x407d78 _start at ???
0xfffffffffffffffe

Update: generic is not required

Fabien-Chouteau commented 1 year ago

Sorry this was closed by mistake.