no.117.mils

来自「一个内存数据库的源代码这是服务器端还有客户端」· MILS 代码 · 共 91 行

MILS
91
字号
# >Number:         117# >Category:       Mserver# >Synopsis:       multiplex fails in a loop# >Confidential:   no# >Severity:       critical# >Priority:       high# >Responsible:    boncz# >State:          open# >Class:          sw-bug# >Submitter-Id:   unknown# >Arrival-Date:   Thu Feb  5 13:46:05 1998# >Originator:     windhouw# >Organization:# UvA# >Release:        971007# >Environment:# # >Description:# The following script fails:# # =====# # test := new(oid,int);# test.insert(oid(1),1);# test.insert(oid(2),2);# test.insert(oid(3),3);# # PROC addNr( any theNrs, any theNr) : any {#         printf("add Nr: %d\n",theNr);#         VAR r := [+](theNrs,theNr);#         r.print;#         return r;# }# # PROC loopTest( any theBAT, any theMax) : void {#         VAR i := 0;#         WHILE (i < theMax) {#                 addNr(theBAT,i);#                 i := i + 1;#         }# }# # =====# # >loopTest(test,1);# add Nr: 0# #-----------------## # oid   | tmp_25  ## #-----------------## [ 1@0,    1       ]# [ 2@0,    2       ]# [ 3@0,    3       ]# >loopTest(test,2);# add Nr: 0# #-----------------## # oid   | tmp_47  ## #-----------------## [ 1@0,    1       ]# [ 2@0,    2       ]# [ 3@0,    3       ]# add Nr: 1# !WARNING: BATdescriptor: range error# ... segmentation fault# # =====# setoid(oid(20000000));var test := new(oid,int);test.insert(oid(1),1);test.insert(oid(2),2);test.insert(oid(3),3);PROC addNr(any theNrs, any theNr) : any {        printf("add Nr: %d\n",theNr);        VAR r := [+](theNrs,theNr);        r.print();        return r;}PROC loopTest(any theBAT,any theMax) : void {        VAR i := 0;        WHILE (i < theMax) {                addNr(theBAT,i);                i := i + 1;        }}loopTest(test,1);loopTest(test,2);quit();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?