freetype: fix tests for stage2 and Face.getGlyphName() #416

Merged
PiergiorgioZagaria merged 1 commit from main into main 2022-07-19 16:11:54 +00:00
PiergiorgioZagaria commented 2022-07-18 08:25:42 +00:00 (Migrated from github.com)
  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

The harfbuzz tests randomly failed to compile with stage2. With the usual fix it doesn't fail anymore, but I wonder how it managed to compile before, and since the behaviour is random there must be some UB in the compiler regarding this. Should I write about this in the stage2 issue?

Also Face.getGlyphName() returned a slice from a buffer on the Stack. I decided to pass the slice to the function, so that memory management of the buffer is left to the user, though this means that the user still has to call sliceTo() on his buffer to get the actual string.

- [X] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right. The harfbuzz tests randomly failed to compile with stage2. With the usual fix it doesn't fail anymore, but I wonder how it managed to compile before, and since the behaviour is random there must be some UB in the compiler regarding this. Should I write about this in the stage2 issue? Also `Face.getGlyphName()` returned a slice from a buffer on the Stack. I decided to pass the slice to the function, so that memory management of the buffer is left to the user, though this means that the user still has to call `sliceTo()` on his buffer to get the actual string.
emidoots (Migrated from github.com) approved these changes 2022-07-19 16:11:32 +00:00
emidoots (Migrated from github.com) left a comment

Looks good, thanks for this.

since the behaviour is random there must be some UB in the compiler regarding this. Should I write about this in the stage2 issue?

Assuming this works, I'm sure it's fine & the Zig authors will catch this on their own (if they haven't already), but feel free to write about it there if you like! Can't hurt

Looks good, thanks for this. > since the behaviour is random there must be some UB in the compiler regarding this. Should I write about this in the stage2 issue? Assuming this works, I'm sure it's fine & the Zig authors will catch this on their own (if they haven't already), but feel free to write about it there if you like! Can't hurt
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!416
No description provided.