We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.14.0-dev.367+a57479afc
In the following code, replacing any usage of IntRange with struct { i32, i32 } will result in a segmentation fault:
IntRange
struct { i32, i32 }
const std = @import("std"); const debug = std.debug; const math = std.math; const sort = std.sort; const IntRange = struct { i32, i32 }; pub fn main() void { const items = [_]IntRange{ // segfaults with struct { i32, i32 } .{ 1, 25 }, .{ 26, 50 }, .{ 51, 75 }, .{ 76, 100 }, }; const key: i32 = 42; const index = sort.binarySearch(IntRange, key, &items, {}, compareFn); // segfaults with struct { i32, i32 } debug.print("{?}\n", .{index}); } fn compareFn(_: void, key: i32, mid_item: struct { i32, i32 }) math.Order { const lo, const hi = mid_item; return if (key < lo) .lt else if (key > hi) .gt else .eq; }
No segfault
The text was updated successfully, but these errors were encountered:
looks like a duplicate of #19497
Sorry, something went wrong.
None of the examples in that issue are giving me a segfault 🤔
#20415 and #20746 look similar to my issue, though
interesting, testing myself and yeah youre right. seems @Vexu mightve been wrong about the others being duplicates?
Only the third example in #19497 crashes now but it is different from this. The other two are the same as this one.
No branches or pull requests
Zig Version
0.14.0-dev.367+a57479afc
Steps to Reproduce and Observed Behavior
In the following code, replacing any usage of
IntRange
withstruct { i32, i32 }
will result in a segmentation fault:Expected Behavior
No segfault
The text was updated successfully, but these errors were encountered: