Skip to content

Commit b42d8e1

Browse files
Fix CobolUtil.checkRefMod method (#267)
1 parent 6a6f059 commit b42d8e1

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1616
* `C$LIST-DIRECTORY` (#264)
1717
### Fixed
1818
* Fix the message of COB_VERBOSE file sort (#260)
19-
* Fix the process that checks moving x to numeric (#266)
19+
* Fix the process that checks MOVE statements (#266, #267)
2020
### Optimized
2121
* Optimize the file reading process (#257)
2222

cobj/typeck.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,11 @@ cb_tree cb_build_identifier(cb_tree x) {
858858
r->length ? cb_build_cast_integer(r->length) : cb_int2,
859859
cb_int(f->size), cb_build_string0((ucharptr)f->name));
860860
} else {
861-
e1 = cb_build_funcall_4(
861+
e1 = cb_build_funcall_5(
862862
"CobolUtil.cobCheckRefMod", cb_build_cast_integer(r->offset),
863863
r->length ? cb_build_cast_integer(r->length) : cb_int1,
864-
cb_int(f->size), cb_build_string0((ucharptr)f->name));
864+
cb_int(f->size), cb_build_string0((ucharptr)f->name),
865+
cb_int(strlen((ucharptr)f->name)));
865866
}
866867
r->check = cb_list_add(r->check, e1);
867868
}

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/common/CobolUtil.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@ public static void cobCheckRefModNational(int offset, long length, int size, Str
114114
CobolUtil.cobCheckRefMod(offset, length, size, name);
115115
}
116116

117+
public static void cobCheckRefMod(
118+
int offset, long length, int size, CobolDataStorage name, int nameLen)
119+
throws CobolStopRunException {
120+
cobCheckRefMod(offset, length, size, name.getByteArrayRef(0, nameLen));
121+
}
122+
123+
public static void cobCheckRefMod(int offset, long length, int size, byte[] name, int nameLen)
124+
throws CobolStopRunException {
125+
cobCheckRefMod(offset, length, size, name);
126+
}
127+
117128
public static void cobCheckRefMod(int offset, long length, int size, byte[] name)
118129
throws CobolStopRunException {
119130
try {
@@ -123,6 +134,11 @@ public static void cobCheckRefMod(int offset, long length, int size, byte[] name
123134
}
124135
}
125136

137+
public static void cobCheckRefMod(int offset, long length, int size, String name, int nameLen)
138+
throws CobolStopRunException {
139+
cobCheckRefMod(offset, length, size, name);
140+
}
141+
126142
public static void cobCheckRefMod(int offset, long length, int size, String name)
127143
throws CobolStopRunException {
128144
/* check the offset */

tests/run.src/ref-mod.at

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ AT_CLEANUP
262262

263263

264264
AT_SETUP([Offset out of bounds in MOVE (2)])
265-
AT_CHECK([${SKIP_TEST}])
266265

267266
AT_DATA([prog.cob], [
268267
IDENTIFICATION DIVISION.

0 commit comments

Comments
 (0)