From ec31bde33a2c0d1543b03b2f71425ec1a4669c70 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 5 Apr 2018 12:23:43 +0300 Subject: [PATCH] fix use of messagesetup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit which does setup for the method being called not the one we’re in. duh --- lib/risc/builtin/object.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/risc/builtin/object.rb b/lib/risc/builtin/object.rb index b3fa93fd..6b3c464d 100644 --- a/lib/risc/builtin/object.rb +++ b/lib/risc/builtin/object.rb @@ -51,7 +51,7 @@ module Risc message_ind = Risc.resolve_to_index( :space , :first_message ) #load the first_message (instance of space) compiler.add_slot_to_reg( "__init__ load 1st message" , space_reg , message_ind , :message) - compiler.add_mom( Mom::MessageSetup.new(compiler.method)) + compiler.add_mom( Mom::MessageSetup.new(Parfait.object_space.get_main)) # but use it's next message, so main can return normally compiler.add_slot_to_reg( "__init__ load 2nd message" , :message , :next_message , :message) compiler.add_load_constant("__init__ load Space", Parfait.object_space , space_reg)