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
When the breakpoint is hit, memory at the address &sha256_1 obviously looks right:
aa aa aa aa aa aa aa aa ªªªªªªªª
aa aa aa aa aa aa aa aa ªªªªªªªª
aa aa aa aa aa aa aa aa ªªªªªªªª
aa aa aa aa aa aa aa aa ªªªªªªªª
00 .
Now the code that I thought should work the same:
varsha256_1: [32:0]u8=undefined;
@breakpoint();
but now memory is
aa aa aa aa aa aa aa aa ªªªªªªªª
aa aa aa aa aa aa aa aa ªªªªªªªª
aa aa aa aa aa aa aa aa ªªªªªªªª
aa aa aa aa aa aa aa aa ªªªªªªªª
aa ª
I'm on windows 11 btw
Expected Behavior
I would expect the sentinel to be initialized, just like I did manually in the first snippet. My intuition is that = undefined would not affect the sentinel. This might be a design decision but I haven't found any issue about it. I understand (guess) there might be efficiency reasons to this behaviour, maybe futurely we can include this in docs.
The text was updated successfully, but these errors were encountered:
I still wish the semantics in my comment were correct, but I’ve been informed that I was mistaken about how sentinel-terminal-arrays actually work. (In particular, I expected operations on the array, like @silversquirl’s example, to use the sentinel to determine the length, when the compile-time length is used instead.)
Zig Version
0.12.0-dev.3533+e5d900268
Steps to Reproduce and Observed Behavior
I'm trying to use [32:0]u8 to interop with C. First, I'll show the code that worked for me:
When the breakpoint is hit, memory at the address
&sha256_1
obviously looks right:Now the code that I thought should work the same:
but now memory is
I'm on windows 11 btw
Expected Behavior
I would expect the sentinel to be initialized, just like I did manually in the first snippet. My intuition is that
= undefined
would not affect the sentinel. This might be a design decision but I haven't found any issue about it. I understand (guess) there might be efficiency reasons to this behaviour, maybe futurely we can include this in docs.The text was updated successfully, but these errors were encountered: