This my worsefix branch renamed, after reflecting I believe this is the correct way to fix it as it removes any side effects from the splice and assembleTables functions in utf8fontfile.go in addition I added a test TestIssue0316, if you back out the previous fix by changing all instances of ReadLikeCopy to just Read you can see the test fails, if you return them or apply this branch then the test passes.
I did go through and check for any other instances of append modifying the underlying arrays. There were a couple I thought might be an issue but once I sat down to inspect them I was able to confirm they were working only on new arrays.
This my
worsefix
branch renamed, after reflecting I believe this is the correct way to fix it as it removes any side effects from thesplice
andassembleTables
functions inutf8fontfile.go
in addition I added a testTestIssue0316
, if you back out the previous fix by changing all instances ofReadLikeCopy
to justRead
you can see the test fails, if you return them or apply this branch then the test passes.I did go through and check for any other instances of append modifying the underlying arrays. There were a couple I thought might be an issue but once I sat down to inspect them I was able to confirm they were working only on new arrays.