-
Notifications
You must be signed in to change notification settings - Fork 915
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
"panic: runtime error: integer divide by zero" when make-ing an array of zero-sized elems #2749
Comments
This should be fixed now. What real-world situation triggers this? How important is minimizing allocations in that case? I hear the fix that was landed may have missed an opportunity to skip one allocation (see discussion on #2750). |
None, it's a corner case of the language. The pattern of making a
I don't think it's particularly important. I can't think of any situation where |
Yeah it would be nice, but only if it can be done by rearranging code (no extra complexity or lines of code). IMHO very low priority considering how little this feature is used. On the other hand, we do actually have some optimizations for |
Building this program:
triggers a panic in tinygo:
It compiles and prints
[{} {} {} {}]
-as expected- with the main Go toolchain.The text was updated successfully, but these errors were encountered: