From fd9f11cbb911dbba34cd14cdde16b34a1a71f9e3 Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Tue, 26 Feb 2019 16:34:09 +0100
Subject: [PATCH] Fixed references to non-existent record of/set of element XER
 descriptors (bug 544828)

Change-Id: Icfc9d61e5d9cf603d7515669a2327fe229a7bcc1
Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
---
 compiler2/Type_codegen.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler2/Type_codegen.cc b/compiler2/Type_codegen.cc
index 7c2381d02..951f0208d 100644
--- a/compiler2/Type_codegen.cc
+++ b/compiler2/Type_codegen.cc
@@ -635,7 +635,8 @@ void Type::generate_code_xerdescriptor(output_struct* target)
   size_t last_len = 2 + last_s.size();    // 2 for > \n
   size_t bxer_len = 2 + bxer_name.size(); // 2 for > \n
   
-  if ((T_SEQOF == last->typetype || T_SETOF == last->typetype)) {
+  if ((T_SEQOF == last->typetype || T_SETOF == last->typetype) &&
+      last->get_ofType()->has_encoding(CT_XER)) {
     oftype_descr_name = mprintf("&%s_xer_", last->u.seof.ofType->get_genname_typedescriptor(my_scope).c_str());
   }
   
-- 
GitLab