From 6a7003f0c7f1afcb1198fdc18e0db0afbff7ac87 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 17 Jan 2014 02:57:06 +0100 Subject: Fix bug21497: do not create an indirection for access to complex type. Add a type check in mcode for New_Address. --- ortho/debug/ortho_debug.adb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ortho/debug') diff --git a/ortho/debug/ortho_debug.adb b/ortho/debug/ortho_debug.adb index 723fe3c..bed2e72 100644 --- a/ortho/debug/ortho_debug.adb +++ b/ortho/debug/ortho_debug.adb @@ -19,6 +19,9 @@ with Ada.Unchecked_Deallocation; package body Ortho_Debug is + -- If True, disable some checks so that the output can be generated. + Disable_Checks : constant Boolean := False; + -- Metrics: -- Alignment and size for an address. Metric_Access_Align : constant Natural := 2; @@ -844,7 +847,6 @@ package body Ortho_Debug is end case; end Get_Base_Type; - procedure Start_Record_Aggr (List : out O_Record_Aggr_List; Atype : O_Tnode) is subtype O_Cnode_Aggregate is O_Cnode_Type (OC_Aggregate); @@ -1118,7 +1120,9 @@ package body Ortho_Debug is raise Type_Error; end if; if Get_Base_Type (Lvalue.Rtype) /= Get_Base_Type (Atype.D_Type) then - raise Type_Error; + if not Disable_Checks then + raise Type_Error; + end if; end if; return new O_Enode_Address'(Kind => OE_Address, Rtype => Atype, -- cgit