Skip to content

Commit e259ff7

Browse files
committed
Fix INDEXED BY in LINKAGE SECTION
Fix a bug where INDEXED BY in LINKAGE SECTION would cause the variable not to be added to the local include file, causing a compile error of the C code.
1 parent f684913 commit e259ff7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cobc/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
2025-01-06 Fabrice Le Fessant <[email protected]>
3+
4+
* parser.y (rule occurs_index): set index_type to CB_INT_INDEX
5+
also for INDEXED BY appaering in LINKAGE SECTION, otherwise
6+
the variable is not added to the local include file
7+
28
2025-01-03 Fabrice Le Fessant <[email protected]>
39

410
* typeck.c (build_evaluate, cb_check_needs_break): fix a bug where

cobc/parser.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8569,7 +8569,8 @@ occurs_index:
85698569
const cb_tree init_val = cb_default_byte == CB_DEFAULT_BYTE_INIT
85708570
? cb_int1 : NULL;
85718571
$$ = cb_build_index ($1, init_val, 1U, current_field);
8572-
if (storage == CB_STORAGE_LOCAL) {
8572+
if (storage == CB_STORAGE_LOCAL ||
8573+
storage == CB_STORAGE_LINKAGE) {
85738574
CB_FIELD_PTR ($$)->index_type = CB_INT_INDEX;
85748575
} else {
85758576
CB_FIELD_PTR ($$)->index_type = CB_STATIC_INT_INDEX;

0 commit comments

Comments
 (0)