X-Git-Url: https://code.kerkeslager.com/?p=fur;a=blobdiff_plain;f=templates%2Farithmetic_instruction.c;h=5b68efd05149d4da8590ed4635f981aba88fe25d;hp=a78a5795e3843795578312b0ef952d7d130b88ca;hb=edc05c8d2d465653c02c350592eff62c542a37ed;hpb=d28e140fd317ef3d63286ba6d87eb0418ee536c9 diff --git a/templates/arithmetic_instruction.c b/templates/arithmetic_instruction.c index a78a579..5b68efd 100644 --- a/templates/arithmetic_instruction.c +++ b/templates/arithmetic_instruction.c @@ -1,12 +1,12 @@ void {{ name }}(struct Thread* thread, const union Argument argument) { - // We're going to reuse result as both the addend and the sum + // We're going to reuse result as both the first input and the result assert(!Stack_isEmpty(&(thread->stack))); Object result = Stack_pop(&(thread->stack)); assert(result.type == INTEGER); assert(!Stack_isEmpty(&(thread->stack))); Object other = Stack_pop(&(thread->stack)); - assert(result.type == INTEGER); + assert(other.type == INTEGER); result.value.integer = other.value.integer {{ operation }} result.value.integer;