.
This commit is contained in:
4
lib/vm.c
4
lib/vm.c
@@ -193,7 +193,7 @@ TYC_RESULT tyc_expr(TycheVM* T, TYC_EXPR expr)
|
|||||||
|
|
||||||
static TYC_RESULT step(TycheVM* T)
|
static TYC_RESULT step(TycheVM* T)
|
||||||
{
|
{
|
||||||
VALUE a, b;
|
VALUE a;
|
||||||
TYC_RESULT r;
|
TYC_RESULT r;
|
||||||
|
|
||||||
Location* loc = location_top(T);
|
Location* loc = location_top(T);
|
||||||
@@ -208,8 +208,6 @@ static TYC_RESULT step(TycheVM* T)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_SUM:
|
case TO_SUM:
|
||||||
TRY(stack_pop(T->stack, &b))
|
|
||||||
TRY(stack_pop(T->stack, &a))
|
|
||||||
TRY(tyc_expr(T, TX_SUM))
|
TRY(tyc_expr(T, TX_SUM))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -369,9 +369,8 @@ static void run_assembly_test(lua_State* L)
|
|||||||
// check stack top
|
// check stack top
|
||||||
lua_getfield(L, -1, "expected_stack_top");
|
lua_getfield(L, -1, "expected_stack_top");
|
||||||
if (lua_isinteger(L, -1)) {
|
if (lua_isinteger(L, -1)) {
|
||||||
int32_t v;
|
TYC_TYPE type; assert(tyc_type(T, -1, &type) == T_OK); assert(type == TT_INTEGER);
|
||||||
assert(tyc_tointeger(T, -1, &v) == T_OK);
|
int32_t v; assert(tyc_tointeger(T, -1, &v) == T_OK); assert(v == lua_tointeger(L, -1));
|
||||||
assert(v == lua_tointeger(L, -1));
|
|
||||||
}
|
}
|
||||||
else if (!lua_isnil(L, -1))
|
else if (!lua_isnil(L, -1))
|
||||||
abort();
|
abort();
|
||||||
|
|||||||
Reference in New Issue
Block a user