Skip to content

Commit

Permalink
Fixed reference table counter (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadeweka authored and Hadeweka committed Sep 25, 2020
1 parent 55fe41b commit ebb9d8c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MrbRefTable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module MrbRefTable
@@content = {} of UInt64 => Tuple(Void*, Int64)
@@logging = false
@@warnings = true
@@options = {} of Symbol => Bool
@@options = {:replace_conflicting_pointers => false}

def self.get(identification)
return @@content[identification][0]
Expand All @@ -20,7 +20,11 @@ module MrbRefTable
if @@content[identification]?
if value != @@content[identification][0]
puts "WARNING: Value #{identification} replaced pointers." if @@warnings
@@content[identification] = {value, @@content[identification][1] + 1} if self.option_active?(:replace_conflicting_pointers)
if self.option_active?(:replace_conflicting_pointers)
@@content[identification] = {value, @@content[identification][1] + 1}
else
@@content[identification] = {@@content[identification][0] , @@content[identification][1] + 1}
end
else
@@content[identification] = {value, @@content[identification][1] + 1}
end
Expand Down

0 comments on commit ebb9d8c

Please sign in to comment.