public CompileUnitEntry GetCompileUnit(int index)
{
if ((index < 1) || (index > ot.CompileUnitCount))
throw new ArgumentException ();
if (reader == null)
throw new InvalidOperationException ();
lock (this) {
CompileUnitEntry unit;
if (compile_unit_hash.TryGetValue (index, out unit))
return unit;
long old_pos = reader.BaseStream.Position;
reader.BaseStream.Position = ot.CompileUnitTableOffset +
CompileUnitEntry.Size * (index - 1);
unit = new CompileUnitEntry (this, reader);
compile_unit_hash.Add (index, unit);
reader.BaseStream.Position = old_pos;
return unit;
}
}