Skip to content

Commit 48d1d84

Browse files
committed
Merge branch 'aoyama' into develop
2 parents b9e2927 + 35db02b commit 48d1d84

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

src/instruction.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ struct InstrSpec spec[] = {
8787
{"tailatomlist", INSTR_TAILATOMLIST, {InstrVar, InstrVar}},
8888
{"atomtailatom", INSTR_ATOMTAILATOM, {InstrVar,InstrVar, InstrVar}},
8989

90+
{"memsetlink", INSTR_MEMSETLINK, {InstrVar, InstrVar}},
91+
9092
{"allocatom", INSTR_ALLOCATOM, {InstrVar, ArgFunctor}},
9193
{"allocatomindirect", INSTR_ALLOCATOMINDIRECT, {InstrVar, InstrVar}},
9294
{"copyatom", INSTR_COPYATOM, {InstrVar, InstrVar, InstrVar}},

src/instruction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ enum LmnInstruction {
252252
INSTR_HEADATOM,
253253
INSTR_TAILATOMLIST,
254254
INSTR_ATOMTAILATOM,
255+
INSTR_MEMSETLINK,
255256

256257
INSTR_PRINTINSTR
257258
};

src/task.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ static BOOL interpret(LmnReactCxt *rc, LmnRule rule, LmnRuleInstr instr)
15221522
}else {
15231523
/* シンボルアトムatom1とシンボルアトムap2 */
15241524
//////
1525-
if(ap2){
1525+
if(ap2 != NULL){
15261526
LMN_SATOM_SET_LINK(ap2, attr2, wt(rc, atom1));
15271527
LMN_SATOM_SET_ATTR(ap2, attr2, pos1);
15281528
LMN_SATOM_SET_LINK(LMN_SATOM(wt(rc, atom1)), pos1, ap2);
@@ -1553,7 +1553,7 @@ static BOOL interpret(LmnReactCxt *rc, LmnRule rule, LmnRuleInstr instr)
15531553
}else if (!LMN_ATTR_IS_EX(at(rc, atom1)) && !LMN_ATTR_IS_EX(attr2)){
15541554
/* シンボルアトムatom1とシンボルアトムap2 */
15551555
//////
1556-
if(ap2){
1556+
if(ap2 != NULL){
15571557
LMN_SATOM_SET_LINK(ap2, attr2, wt(rc, atom1));
15581558
LMN_SATOM_SET_ATTR(ap2, attr2, pos1);
15591559
LMN_SATOM_SET_LINK(LMN_SATOM(wt(rc, atom1)), pos1, ap2);
@@ -1573,7 +1573,7 @@ static BOOL interpret(LmnReactCxt *rc, LmnRule rule, LmnRuleInstr instr)
15731573
&& !LMN_ATTR_IS_EX(attr1) && !LMN_ATTR_IS_EX(attr2)){
15741574
/* シンボルアトムatom2とシンボルアトムap1 */
15751575

1576-
if(ap1){
1576+
if(ap1 != NULL){
15771577
LMN_SATOM_SET_LINK(LMN_SATOM(wt(rc, atom2)), pos2, ap1);
15781578
LMN_SATOM_SET_ATTR(LMN_SATOM(wt(rc, atom2)), pos2, LMN_ATTR_GET_VALUE(attr1));
15791579
LMN_SATOM_SET_LINK(ap1, attr1, wt(rc, atom2));
@@ -1593,7 +1593,7 @@ static BOOL interpret(LmnReactCxt *rc, LmnRule rule, LmnRuleInstr instr)
15931593
}else {
15941594
/* シンボルアトムatom1とシンボルアトムap2 */
15951595
//////
1596-
if(ap2){
1596+
if(ap2 != NULL){
15971597
LMN_SATOM_SET_LINK(ap2, LMN_ATTR_GET_VALUE(attr2), wt(rc, atom1));
15981598
LMN_SATOM_SET_ATTR(ap2, LMN_ATTR_GET_VALUE(attr2), pos1);
15991599
LMN_SATOM_SET_LINK(LMN_SATOM(wt(rc, atom1)), pos1, ap2);
@@ -1795,6 +1795,18 @@ static BOOL interpret(LmnReactCxt *rc, LmnRule rule, LmnRuleInstr instr)
17951795
move_atom_to_atom_tail((LmnSAtom)wt(rc,atomi),(LmnSAtom)wt(rc,atomi2),(LmnMembrane *)wt(rc,memi));
17961796
break;
17971797
}
1798+
case INSTR_MEMSETLINK:
1799+
{
1800+
LmnInstrVar atomi, link;
1801+
1802+
READ_VAL(LmnInstrVar, instr, atomi);
1803+
READ_VAL(LmnInstrVar, instr, link);
1804+
1805+
1806+
LMN_SATOM_SET_LINK(wt(rc,atomi), link, NULL);
1807+
1808+
break;
1809+
}
17981810
case INSTR_NEWMEM:
17991811
{
18001812
LmnInstrVar newmemi, parentmemi, memf;

0 commit comments

Comments
 (0)