From 86ee6557cf3da6dc08586b66bf15d2a95be5cf0e Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 5 Aug 2018 13:11:12 -0700 Subject: [PATCH] Fix bug in codegen. --- src/chalk/codegen.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chalk/codegen.cr b/src/chalk/codegen.cr index 53e8068..d8a3228 100644 --- a/src/chalk/codegen.cr +++ b/src/chalk/codegen.cr @@ -134,7 +134,8 @@ module Chalk cond_jump.offset = @instructions.size - old_size + 1 after_jump.offset = before_cond - instructions.size + 1 when Trees::TreeReturn - generate! tree.rvalue, table, RETURN_REG, free + generate! tree.rvalue, table, free, free + 1 + loadr RETURN_REG, free ret end return 0