You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was playing around manually modifying the Table in one package and was surprised to find out that it causes CRC32 errors in another package.
The name MakeTable seems to indicate that a unique table will be created and returned. But for the IEEE and Castagnoli polynomials specifically, it returns a reference to tables held globally. This has the following consequences:
Explicitly say that *Table returned by MakeTable may not be
modified. Otherwise, this leads to very subtle bugs that may
or may not manifest themselves.
Same comment was made on package crc64, to keep the future
open to the caching tables that crc32 effectively does.
Fixes: #12487.
Change-Id: I2881bebb8b16f6f8564412172774c79c2593c6c1
Reviewed-on: https://go-review.googlesource.com/14258
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Was playing around manually modifying the Table in one package and was surprised to find out that it causes CRC32 errors in another package.
The name
MakeTable
seems to indicate that a unique table will be created and returned. But for the IEEE and Castagnoli polynomials specifically, it returns a reference to tables held globally. This has the following consequences:See https://play.golang.org/p/IWehs0lQAc
The text was updated successfully, but these errors were encountered: