-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/go/ssa: bad code generation for struct declaration and assignment #10127
Comments
Hi Elliot, thanks for reporting this bug. I understand what's wrong. The fix is rather involved so I may not get to it today. |
No problem Alan, thank you for looking at it so promptly. I've programmed round that particular instance of the problem; and as the problem probably only occurs in a very unusual set of circumstances, while I wait for your fix I can look out for those circumstances if I hit an inexplicable error again. It's a tribute to the quality your SSA code that I've got 60+ standard library packages passing their tests so far and this is the first bug I've found. |
Fix pending. |
Thank you for fixing this so quickly Alan, the patch does solve my problem; both in the small test case and for tardisgo/haxe running the compress/flate tests. |
This issue is fixed in the revised x/tools/go/ssa so I'm closing the issue. Thank you again for dealing with it so quickly. |
Issue discovered in http://golang.org/src/compress/flate/inflate.go
when testing that package in https://github.com/tardisgo/tardisgo
using go version go1.4.2 darwin/amd64
Program demonstrating error: reset.go
Offending code generated:
The problem is that *f is overwritten and then used to fetch a field value.
Using a temporary variable in Go fixes the problem, see the ResetOK method.
The text was updated successfully, but these errors were encountered: