summaryrefslogtreecommitdiff
path: root/src/ortho
diff options
context:
space:
mode:
Diffstat (limited to 'src/ortho')
-rw-r--r--src/ortho/debug/ortho_debug.adb4
-rw-r--r--src/ortho/gcc/ortho_gcc.ads4
-rw-r--r--src/ortho/llvm/ortho_llvm.ads4
-rw-r--r--src/ortho/ortho_nodes.common.ads4
4 files changed, 9 insertions, 7 deletions
diff --git a/src/ortho/debug/ortho_debug.adb b/src/ortho/debug/ortho_debug.adb
index ca67b33..b1ec1b6 100644
--- a/src/ortho/debug/ortho_debug.adb
+++ b/src/ortho/debug/ortho_debug.adb
@@ -967,7 +967,9 @@ package body Ortho_Debug is
is
subtype O_Lnode_Selected_Element is O_Lnode_Type (OL_Selected_Element);
begin
- if Rec.Rtype.Kind /= ON_Record_Type then
+ if Rec.Rtype.Kind /= ON_Record_Type
+ and then Rec.Rtype.Kind /= ON_Union_Type
+ then
raise Type_Error;
end if;
if Rec.Rtype /= El.Parent then
diff --git a/src/ortho/gcc/ortho_gcc.ads b/src/ortho/gcc/ortho_gcc.ads
index 7ed83d2..6f43be4 100644
--- a/src/ortho/gcc/ortho_gcc.ads
+++ b/src/ortho/gcc/ortho_gcc.ads
@@ -290,8 +290,8 @@ package Ortho_Gcc is
function New_Slice (Arr : O_Lnode; Res_Type : O_Tnode; Index : O_Enode)
return O_Lnode;
- -- Get an element of a record.
- -- Type of REC must be a record type.
+ -- Get an element of a record or a union.
+ -- Type of REC must be a record or a union type.
function New_Selected_Element (Rec : O_Lnode; El : O_Fnode)
return O_Lnode;
diff --git a/src/ortho/llvm/ortho_llvm.ads b/src/ortho/llvm/ortho_llvm.ads
index 931977b..69a850f 100644
--- a/src/ortho/llvm/ortho_llvm.ads
+++ b/src/ortho/llvm/ortho_llvm.ads
@@ -313,8 +313,8 @@ package Ortho_LLVM is
function New_Slice (Arr : O_Lnode; Res_Type : O_Tnode; Index : O_Enode)
return O_Lnode;
- -- Get an element of a record.
- -- Type of REC must be a record type.
+ -- Get an element of a record or a union.
+ -- Type of REC must be a record or a union type.
function New_Selected_Element (Rec : O_Lnode; El : O_Fnode)
return O_Lnode;
diff --git a/src/ortho/ortho_nodes.common.ads b/src/ortho/ortho_nodes.common.ads
index 1781874..f9caf32 100644
--- a/src/ortho/ortho_nodes.common.ads
+++ b/src/ortho/ortho_nodes.common.ads
@@ -284,8 +284,8 @@ package ORTHO_NODES is
function New_Slice (Arr : O_Lnode; Res_Type : O_Tnode; Index : O_Enode)
return O_Lnode;
- -- Get an element of a record.
- -- Type of REC must be a record type.
+ -- Get an element of a record or a union.
+ -- Type of REC must be a record or a union type.
function New_Selected_Element (Rec : O_Lnode; El : O_Fnode)
return O_Lnode;