Skip to content

Commit

Permalink
Fixed integer < comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
lep committed Mar 4, 2023
1 parent 81cf684 commit 2d7a22c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/interpreter.j
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ function _step takes integer _ctx returns integer

elseif _t == Ins#_Lt then
if Ins#_type[_op] == Types#_integer then
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_integer(Context#_locals[_ctx], Ins#_a2[_op]) < Table#_get_integer(Context#_locals[_ctx], Ins#_a2[_op]))
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_integer(Context#_locals[_ctx], Ins#_a2[_op]) < Table#_get_integer(Context#_locals[_ctx], Ins#_a3[_op]))
else
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_real(Context#_locals[_ctx], Ins#_a2[_op]) < Table#_get_real(Context#_locals[_ctx], Ins#_a3[_op]))
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_real (Context#_locals[_ctx], Ins#_a2[_op]) < Table#_get_real (Context#_locals[_ctx], Ins#_a3[_op]))
endif

elseif _t == Ins#_Le then
if Ins#_type[_op] == Types#_integer then
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_integer(Context#_locals[_ctx], Ins#_a2[_op]) <= Table#_get_integer(Context#_locals[_ctx], Ins#_a3[_op]))
else
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_real(Context#_locals[_ctx], Ins#_a2[_op]) <= Table#_get_real(Context#_locals[_ctx], Ins#_a3[_op]))
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_real (Context#_locals[_ctx], Ins#_a2[_op]) <= Table#_get_real (Context#_locals[_ctx], Ins#_a3[_op]))
endif

elseif _t == Ins#_Gt then
Expand All @@ -72,7 +72,7 @@ function _step takes integer _ctx returns integer
if Ins#_type[_op] == Types#_integer then
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_integer(Context#_locals[_ctx], Ins#_a2[_op]) >= Table#_get_integer(Context#_locals[_ctx], Ins#_a3[_op]))
else
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_real(Context#_locals[_ctx], Ins#_a2[_op]) >= Table#_get_real(Context#_locals[_ctx], Ins#_a3[_op]))
call Table#_set_boolean(Context#_locals[_ctx], Ins#_a1[_op], Table#_get_real (Context#_locals[_ctx], Ins#_a2[_op]) >= Table#_get_real (Context#_locals[_ctx], Ins#_a3[_op]))
endif

elseif _t == Ins#_Eq then
Expand Down

0 comments on commit 2d7a22c

Please sign in to comment.