Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package classfile

import scala.language.unsafeNulls

import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler }
import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler, UnpickleException }

import Contexts.*, Symbols.*, Types.*, Names.*, StdNames.*, NameOps.*, Scopes.*, Decorators.*
import SymDenotations.*, unpickleScala2.Scala2Unpickler.*, Constants.*, Annotations.*, util.Spans.*
Expand Down Expand Up @@ -306,7 +306,9 @@ class ClassfileParser(
catch {
case e: RuntimeException =>
if (ctx.debug) e.printStackTrace()
val addendum = Header.Version.brokenVersionAddendum(classfileVersion)
val addendum = e match
case _: UnpickleException => ""
case _ => Header.Version.brokenVersionAddendum(classfileVersion)
throw new IOException(
i""" class file ${classfile.canonicalPath} is broken$addendum,
| reading aborted with ${e.getClass}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import dotty.tools.dotc.core.Symbols.*
import dotty.tools.dotc.core.Types.*
import dotty.tools.dotc.util.*
import dotty.tools.io.AbstractFile
import dotty.tools.tasty.TastyReader
import dotty.tools.tasty.{ TastyReader, UnpickleException }

import ClassfileParser.Header

Expand All @@ -37,7 +37,9 @@ class ClassfileTastyUUIDParser(classfile: AbstractFile)(ictx: Context) {
catch {
case e: RuntimeException =>
if (ctx.debug) e.printStackTrace()
val addendum = Header.Version.brokenVersionAddendum(classfileVersion)
val addendum = e match
case _: UnpickleException => ""
case _ => Header.Version.brokenVersionAddendum(classfileVersion)
throw new IOException(
i""" class file ${classfile.canonicalPath} is broken$addendum,
| reading aborted with ${e.getClass}:
Expand Down
Loading