-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Conversation
… 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
Message from Gerrit User 5976: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/128479. |
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. |
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. |
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. |
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. |
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. |
Message from Gerrit User 27741: Patch Set 1: (1 comment)
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. |
Message from Gerrit User 5206: Patch Set 1:
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. |
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 |
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. |
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. |
Message from Gerrit User 5206: Patch Set 3: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/128479. |
Message from Gerrit User 27741: Patch Set 3: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/128479. |
…present incorporating code review comments
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 |
Message from Gerrit User 5206: Patch Set 4: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/128479. |
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. |
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. |
Message from Gerrit User 5206: Patch Set 4: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/128479. |
…present updating comment on funcTypeFixedXX structs
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 |
Message from Gerrit User 5206: Patch Set 5: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/128479. |
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. |
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. |
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>
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. |
This PR is being closed because golang.org/cl/128479 has been merged. |
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