Skip to content

Commit

Permalink
Fix bugs in equality checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
icecocoa6 authored and nikosai committed Jul 5, 2019
1 parent b145256 commit f5e2766
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/vm/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3760,6 +3760,8 @@ bool slim::vm::interpreter::exec_command(LmnReactCxt *rc, LmnRuleRef rule,
if (!(lmn_hyperlink_at_to_hl((LmnSymbolAtomRef)rc->wt(func0)))->eq_hl(lmn_hyperlink_at_to_hl((LmnSymbolAtomRef)rc->wt(func1))))
return FALSE;
break;
case LMN_SP_ATOM_ATTR:
if (!SP_ATOM_EQ(rc->wt(func0), rc->wt(func1))) return FALSE;
default:
if (rc->wt(func0) != rc->wt(func1))
return FALSE;
Expand Down Expand Up @@ -3788,6 +3790,8 @@ bool slim::vm::interpreter::exec_command(LmnReactCxt *rc, LmnRuleRef rule,
if ((lmn_hyperlink_at_to_hl((LmnSymbolAtomRef)rc->wt(func0)))->eq_hl(lmn_hyperlink_at_to_hl((LmnSymbolAtomRef)rc->wt(func1))))
return FALSE;
break;
case LMN_SP_ATOM_ATTR:
if (SP_ATOM_EQ(rc->wt(func0), rc->wt(func1))) return FALSE;
default:
if (rc->wt(func0) == rc->wt(func1))
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion test/system_check/testsuite/guard_string/case4.lmntest
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
eq($s,$t) :- $s == $t | yes. eq("hello", 'hello').
eq($s,$t) :- $s == $t | yes. eq("hello", "hell").
yes.
ng
2 changes: 1 addition & 1 deletion test/system_check/testsuite/guard_string/case5.lmntest
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
neq($s, $t) :- string($s), unary($t), $s \= $t | yes. neq("hello", 'hello').
neq($s, $t) :- string($s), string($t), $s \= $t | yes. neq("hello", "hell").
yes.
ok
2 changes: 1 addition & 1 deletion test/system_check/testsuite/guard_string/case6.lmntest
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
neq($s, $t) :- string($s), string($t), $s \= $t | yes. neq("hello", 'hello').
neq($s, $t) :- string($s), string($t), $s \= $t | yes. neq("hello", "hello").
yes.
ng

0 comments on commit f5e2766

Please sign in to comment.