diff --git a/cobj/codegen.c b/cobj/codegen.c index 8770cc13..385b90a2 100644 --- a/cobj/codegen.c +++ b/cobj/codegen.c @@ -890,6 +890,7 @@ static void joutput_base(struct cb_field *f) { } if (cb_field_variable_address(f)) { + int firstLoop = 1; for (p = f->parent; p; f = f->parent, p = f->parent) { for (p = p->children; p != f; p = p->sister) { struct cb_field *v = cb_field_variable_size(p); @@ -900,9 +901,16 @@ static void joutput_base(struct cb_field *f) { } joutput_integer(v->occurs_depending); } else { - joutput(" + %d", p->size * p->occurs_max); + if (firstLoop) { + joutput(".getSubDataStorage("); + joutput("%d", p->size * p->occurs_max); + firstLoop = 0; + } else { + joutput(" + %d", p->size * p->occurs_max); + } } } + joutput(")"); } } } diff --git a/cobj/pplex.c b/cobj/pplex.c index 0f3b1b43..5856d9e8 100644 --- a/cobj/pplex.c +++ b/cobj/pplex.c @@ -1,7 +1,10 @@ #line 1 "pplex.c" +#line 1 "pplex.c" +#line 3 "pplex.c" #line 3 "pplex.c" +#define YY_INT_ALIGNED short int #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ @@ -385,6 +388,7 @@ typedef unsigned int flex_uint32_t; #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -403,6 +407,7 @@ typedef unsigned int flex_uint32_t; /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE diff --git a/cobj/scanner.c b/cobj/scanner.c index fa122cb5..4b92f3c1 100644 --- a/cobj/scanner.c +++ b/cobj/scanner.c @@ -3618,6 +3618,12 @@ read_literal (int mark, enum cb_category category) } while ((c = input ()) != EOF) { +#if EOF != 0 + if (unlikely (c == 0)){ + cb_error(_("The literal is not properly closed by %c."), mark); + break; + } +#endif plexbuff[i++] = c; if (c == mark && (c = input ()) != mark) { i--; diff --git a/cobj/scanner.l b/cobj/scanner.l index 61a46b40..bc9e1c41 100644 --- a/cobj/scanner.l +++ b/cobj/scanner.l @@ -801,6 +801,12 @@ read_literal (int mark, enum cb_category category) } while ((c = input ()) != EOF) { +#if EOF != 0 + if (unlikely (c == 0)){ + cb_error(_("The literal is not properly closed by %c."), mark); + break; + } +#endif plexbuff[i++] = c; if (c == mark && (c = input ()) != mark) { i--;