Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

複数プログラム実行時のCANCEL ALLに関する問題 / Problems with CANCEL ALL when running multiple programs #46

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions libcob/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,8 @@ cob_cancel_call_stack_list (struct call_stack_list *p)
if (p->children) {
cob_cancel_call_stack_list (p->children);
}
struct call_stack_list *s = p->sister;
while (s != NULL) {
cob_cancel_call_stack_list (s);
s = s->sister;
if (p->sister) {
cob_cancel_call_stack_list (p->sister);
}
}

Expand Down Expand Up @@ -768,7 +766,7 @@ cob_push_call_stack_list (char *name)
}
p = p->sister;
}
current_call_stack_list->sister = cob_create_call_stack_list (name);
p->sister = cob_create_call_stack_list (name);
return;
}

Expand Down
65 changes: 65 additions & 0 deletions tests/run.src/misc.at
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,71 @@ AT_CHECK([./prog], [0],

AT_CLEANUP

AT_SETUP([CANCEL ALL horizontal program])

AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
PROCEDURE DIVISION.
CALL "call01"
END-CALL.
CALL "call02"
END-CALL.
CALL "call03"
END-CALL.
CANCEL ALL.
CALL "call01"
END-CALL.
CALL "call02"
END-CALL.
CALL "call03"
END-CALL.
STOP RUN.
])

AT_DATA([call01.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. call01.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
GOBACK.
])

AT_DATA([call02.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. call02.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
GOBACK.
])

AT_DATA([call03.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. call03.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 X PIC 9.
PROCEDURE DIVISION.
ADD 1 TO X.
DISPLAY X
END-DISPLAY.
EXIT PROGRAM.
GOBACK.
])

AT_CHECK([${COMPILE} -o prog prog.cob])
AT_CHECK([${COMPILE_MODULE} call01.cob])
AT_CHECK([${COMPILE_MODULE} call02.cob])
AT_CHECK([${COMPILE_MODULE} call03.cob])
AT_CHECK([./prog], [0],
[1
1
])

AT_CLEANUP

AT_SETUP([CALL binary literal parameter/LENGTH OF - so])

AT_CHECK([test $SHREXT != "dll" || exit 77])
Expand Down