From c245272e52e348418d76ee50c01334e68dbf1d92 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 28 Oct 2015 14:37:40 +0200 Subject: [PATCH] don't export current --- lib/register/builtin/kernel.rb | 2 +- lib/register/method_source.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/register/builtin/kernel.rb b/lib/register/builtin/kernel.rb index 1f2b7f98..14c3b77d 100644 --- a/lib/register/builtin/kernel.rb +++ b/lib/register/builtin/kernel.rb @@ -10,7 +10,7 @@ module Register # no method enter or return (automatically added), remove new_start = Label.new(function , "__init__" ) function.instructions = new_start - function.source.current = new_start + function.source.set_current new_start #Set up the Space as self upon init space = Parfait::Space.object_space diff --git a/lib/register/method_source.rb b/lib/register/method_source.rb index aa11851d..52d472c7 100644 --- a/lib/register/method_source.rb +++ b/lib/register/method_source.rb @@ -58,8 +58,11 @@ module Register add_code FunctionReturn.new( self , Register.new_message_reg , Register.resolve_index(:message , :return_address) ) @current = enter end - attr_accessor :current , :method + attr_accessor :method + def set_current c + @current = c + end # add an instruction after the current (insertion point) # the added instruction will become the new insertion point def add_code instruction