not recursing into labels to avoid infinite loops

This commit is contained in:
Torsten Ruger 2014-07-18 00:29:45 +03:00
parent e02c6ed082
commit 98db88ac2f

View File

@ -18,6 +18,22 @@ module Virtual
def initialize nex = nil def initialize nex = nil
@next = nex @next = nex
end end
# simple thought: don't recurse for labels, just check their names
def == other
return false unless other.class == self.class
attributes.each do |a|
left = send(a)
right = other.send(a)
return false unless left.class == right.class
if( left.is_a? Label)
return false unless left.name == right.name
else
return false unless left == right
end
end
return true
end
end end
module Named module Named