From dc8afce444b6fe45c9384da374b561b8f749c6d9 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 16 May 2018 12:55:51 +0300 Subject: [PATCH] use existing constant --- lib/mom/instruction/slot_definition.rb | 2 +- lib/parfait/object.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mom/instruction/slot_definition.rb b/lib/mom/instruction/slot_definition.rb index 942d206f..a8167836 100644 --- a/lib/mom/instruction/slot_definition.rb +++ b/lib/mom/instruction/slot_definition.rb @@ -72,7 +72,7 @@ module Mom const << Risc::SlotToReg.new( instruction , right ,index, right) if slots.length > 2 raise "3 slots only for type #{slots}" unless slots[2] == :type - const << Risc::SlotToReg.new( instruction , right , 0, right) + const << Risc::SlotToReg.new( instruction , right , Parfait::TYPE_INDEX, right) end end const diff --git a/lib/parfait/object.rb b/lib/parfait/object.rb index c871f14c..9c3beba5 100644 --- a/lib/parfait/object.rb +++ b/lib/parfait/object.rb @@ -39,7 +39,7 @@ module Parfait # 0 -based index def set_internal_word(index , value) - return set_type(value) if( index == 0) + return set_type(value) if( index == TYPE_INDEX) raise "not type #{@type.class}" unless @type.is_a?(Type) name = @type.name_at(index) #return value unless name