diff --git a/lib/register/register_reference.rb b/lib/register/register_reference.rb index 251b098b..85848006 100644 --- a/lib/register/register_reference.rb +++ b/lib/register/register_reference.rb @@ -10,9 +10,6 @@ module Register attr_accessor :symbol def initialize r - if( r.is_a? Fixnum) - r = "r#{r}".to_sym - end raise "wrong type for register init #{r}" unless r.is_a? Symbol raise "double r #{r}" if r == :rr1 @symbol = r diff --git a/lib/virtual/parfait_adapter.rb b/lib/virtual/parfait_adapter.rb index 9c561035..bb4b7ea3 100644 --- a/lib/virtual/parfait_adapter.rb +++ b/lib/virtual/parfait_adapter.rb @@ -20,8 +20,9 @@ module FakeMem raise "Class not found #{vm_name}" unless clazz self.set_layout clazz.object_layout end + #TODO, this is copied from module Positioned, maybe avoid duplication ? def position - raise "position accessed but not set at #{length} for #{self.inspect[0...500]}" if @position == nil + raise "position accessed but not set at #{mem_length} for #{self.inspect[0...1000]}" if @position == nil @position end def set_position pos @@ -88,7 +89,9 @@ module Parfait def to_s Sof::Writer.write(self) end - + def inspect + to_s + end end class List def mem_length diff --git a/lib/virtual/positioned.rb b/lib/virtual/positioned.rb index 638f67fa..aa72bedd 100644 --- a/lib/virtual/positioned.rb +++ b/lib/virtual/positioned.rb @@ -2,7 +2,7 @@ require_relative "type" module Positioned def position - raise "position accessed but not set at #{length} for #{self.inspect[0...500]}" if @position == nil + raise "position accessed but not set at #{mem_length} for #{self.inspect[0...500]}" if @position == nil @position end def set_position pos