Skip to content
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

reflect: fix StructOf panics from too many methods in embedded fields #26865

Closed
wants to merge 6 commits into from

Conversation

jamdagni86
Copy link
Contributor

@jamdagni86 jamdagni86 commented Aug 8, 2018

Previously we panicked if the number of methods present for an embedded
field was >= 32. This change removes that limit and now StructOf
dynamically calls itself to create space for the number of methods.

Fixes #25402

… embedded field with more than 32 mehtods is present.

Structs with embedded fields having methods are represented by structTypeFixed4 ... structTypeFixed32. Any embedded field with more than 32 mehtods used to panic as that was the default action.

Solution: StructOf calls calls itself recursively to create structTypeFixedN dynamically by allocating enough space for N methods present in the embedded type.

Fixes golang#25402
@googlebot googlebot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Aug 8, 2018
@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5206:

Patch Set 1:

Thanks, will look at this after the 1.11 release.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5137:

Patch Set 1: Run-TryBot+1

Thank you for this fix Raghavendra! I've also added David and Ian as the experts to help review this change.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 1:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=50269ff9


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 1: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5137:

Patch Set 1:

(1 comment)

I've also added a suggestion for the commit message, please feel free to correct me or update it accordingly.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 27741:

Patch Set 1:

(1 comment)

Patch Set 1:

(1 comment)

I've also added a suggestion for the commit message, please feel free to correct me or update it accordingly.

I guess this message is coming from the title of the PR. The actual commit message explains the fix and the bug.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5206:

Patch Set 1:

I've also added a suggestion for the commit message, please feel free to correct me or update it accordingly.

I guess this message is coming from the title of the PR. The actual commit message explains the fix and the bug.

The point is that the actual commit message is not showing up in Gerrit. See the bottom of https://github.com/golang/go/wiki/CommitMessage#github-pull-requests .


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@jamdagni86 jamdagni86 changed the title reflect: fix StructOf panics when an embedded field is present reflect: fix StructOf panics from too many methods in embedded fields Nov 2, 2018
@gopherbot
Copy link
Contributor

This PR (HEAD: c449aa5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/128479 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Gerrit User 12446:

Uploaded patch set 2: Commit message was updated.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 12446:

Uploaded patch set 3: Commit message was updated.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5206:

Patch Set 3:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 27741:

Patch Set 3:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 5505d5e) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/128479 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Gerrit User 5206:

Patch Set 4: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 4:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=0e8c461b


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 4: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5206:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 16da71a) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/128479 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Gerrit User 5206:

Patch Set 5: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 5:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=b77a63e4


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gerrit User 5976:

Patch Set 5: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Nov 6, 2018
Previously we panicked if the number of methods present for an embedded
field was >= 32. This change removes that limit and now StructOf
dynamically calls itself to create space for the number of methods.

Fixes #25402

Change-Id: I3b1deb119796d25f7e6eee1cdb126327b49a0b5e
GitHub-Last-Rev: 16da71a
GitHub-Pull-Request: #26865
Reviewed-on: https://go-review.googlesource.com/c/128479
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@gopherbot
Copy link
Contributor

Message from Gerrit User 5206:

Patch Set 5: Code-Review+2

Thanks for pushing this through.


Please don’t reply on this GitHub thread. Visit golang.org/cl/128479.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/128479 has been merged.

@gopherbot gopherbot closed this Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants