From 6e9cd12b2ac215cb16545f4c59af57048478a3e4 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sat, 25 Oct 2008 21:04:55 +0200 Subject: [PATCH] forb-idl: Fixed uninitialized sequences in skeletons --- forb-idl/forb-idl-c-common.c | 1 - forb-idl/forb-idl-c-skels.c | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/forb-idl/forb-idl-c-common.c b/forb-idl/forb-idl-c-common.c index 120a3c6..194f9b8 100644 --- a/forb-idl/forb-idl-c-common.c +++ b/forb-idl/forb-idl-c-common.c @@ -200,7 +200,6 @@ cc_output_ser_seqence(OIDL_C_Info *ci, " int i;\n" " CORBA_boolean ok;\n" " ok = CORBA_unsigned_long_deserialize(codec, &ptr->_length);\n" - " ok = ok && (ptr->_length <= ptr->_maximum);\n" " if (ok) {\n" " if (CORBA_sequence_get_release(ptr)) CORBA_free(ptr->_buffer);\n" " ptr->_buffer = %s_allocbuf(ptr->_length);\n" diff --git a/forb-idl/forb-idl-c-skels.c b/forb-idl/forb-idl-c-skels.c index d3348dc..fd1d550 100644 --- a/forb-idl/forb-idl-c-skels.c +++ b/forb-idl/forb-idl-c-skels.c @@ -252,6 +252,7 @@ static void ck_output_op_skel(IDL_tree op, char *intf_id, OIDL_Run_Info *rinfo, char *id, *id_plain; IDL_tree sub; gboolean has_retval, has_args; + const char *const seq_init = " = {0,0,NULL}"; has_retval = IDL_OP_DCL (op).op_type_spec != NULL; has_args = IDL_OP_DCL (op).parameter_dcls != NULL; @@ -281,12 +282,15 @@ static void ck_output_op_skel(IDL_tree op, char *intf_id, OIDL_Run_Info *rinfo, fprintf(ci->fh, " "); forb_cbe_write_typespec(ci->fh, IDL_PARAM_DCL(parm).param_type_spec); - fprintf(ci->fh, " %s%s;\n", n == 2 ? "*":"", name); + fprintf(ci->fh, " %s%s%s;\n", + n == 2 ? "*":"", + name, + (n < 2 && IDL_NODE_TYPE(ts) == IDLN_TYPE_SEQUENCE)?seq_init : ""); } if (has_retval) { fprintf (ci->fh, " "); forb_cbe_write_param_typespec (ci->fh, op); - fprintf (ci->fh, " _forb_ret;\n"); + fprintf (ci->fh, " _forb_ret;\n"); /* TODO: seq_init */ } /* Deserialize in parameters */ -- 2.39.2