John Lam 1997 — 2026

reference_file bug in third drop of RubyCLR

I just found a bug in RubyCLR that could potentially break the way enumerations (and potentially generic types) are handled. If you call RubyClr::reference_file more than once for the same assembly, I’ll parse the assembly more than once (this is the bug).

Here’s a patch that will fix this bug. You’ll need to replace the method body for reference_file in core.rb.

def self.reference_file(assembly_path)
  @@assembly_filenames ||= []
  if @@assembly_filenames.include?(assembly_path)
    false
  else
    generate_modules(internal_reference_file(assembly_path))
    @@assembly_filenames << assembly_path
    true
  end
end

Yes, I’m working on getting the source loaded into rubyforge, but I need to carve out some time to make that happen.

Please let me know if you have any problems with the bridge. jlam at this domain or via the comments.