Skip to content

Fix #1544: don't fail assertion in TastyPickler when signature is longer than 128 bytes #1572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented Oct 9, 2016

Fixes #1544 following suggestions there—this raises the maximum length field to 2^14. However, if this "fix prototype" fixes the immediate problem, I should probably replace the assertion by a proper error.

As implied there, the reading side appears to need no changes. Still only minimally tested.

  • Squash/rebase commits
  • Test separate compilation.

@Blaisorblade Blaisorblade force-pushed the 1544-extend-name-length branch from 08f6ce3 to 48a412e Compare October 10, 2016 00:09
@@ -42,11 +42,13 @@ class NameBuffer extends TastyBuffer(10000) {

private def withLength(op: => Unit): Unit = {
val lengthAddr = currentAddr
writeByte(0)
val lengthFieldLength = 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A design goal of pickling is to be as compact as possible. Wasting one byte for each name is not compatible with that. We should find a scheme that needs the second byte only for long names. I would propose an optional parameter

def withLength(op: => Unit, maxLength: Int = 127)

which gets specialized in writeName.

@odersky
Copy link
Contributor

odersky commented Oct 13, 2016

Superseded by #1588.

@odersky odersky closed this Oct 13, 2016
@Blaisorblade Blaisorblade deleted the 1544-extend-name-length branch October 13, 2016 09:52
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this pull request Dec 8, 2016
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this pull request Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method call in object with more than 109 parameters fails assertion in TastyPickler.
2 participants