Skip to content

Commit 42a5dd4

Browse files
committed
Address review
1 parent fc115b4 commit 42a5dd4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

+5-7
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ object ClassfileParser {
5050
mapOver(tp)
5151
}
5252
}
53-
54-
def withReader[T](classfile: AbstractFile)(op: DataReader ?=> T)(using Context): T =
55-
ctx.base.reusableDataReader.using { reader =>
56-
op(using reader.reset(classfile))
57-
}
5853
}
5954

6055
class ClassfileParser(
@@ -86,11 +81,14 @@ class ClassfileParser(
8681
private def mismatchError(className: SimpleName) =
8782
throw new IOException(s"class file '${classfile.canonicalPath}' has location not matching its contents: contains class $className")
8883

89-
def run()(using Context): Option[Embedded] = try withReader(classfile) { (using in) =>
84+
def run()(using Context): Option[Embedded] = try ctx.base.reusableDataReader.using { reader =>
85+
implicit val reader2 = reader.reset(classfile)
9086
report.debuglog("[class] >> " + classRoot.fullName)
9187
parseHeader()
9288
this.pool = new ConstantPool
93-
parseClass()
89+
val res = parseClass()
90+
this.pool = null
91+
res
9492
}
9593
catch {
9694
case e: RuntimeException =>

0 commit comments

Comments
 (0)