Skip to content

Commit

Permalink
Fix #12829
Browse files Browse the repository at this point in the history
  • Loading branch information
tau-dev committed Jul 16, 2024
1 parent 04512a3 commit 88b104a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/std/builtin.zig
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ pub const panic_messages = struct {
pub const divide_by_zero = "division by zero";
pub const exact_division_remainder = "exact division produced remainder";
pub const inactive_union_field = "access of inactive union field";
pub const integer_part_out_of_bounds = "integer part of floating point value out of bounds";
pub const integer_part_out_of_bounds = "integer part of floating point value out of bounds or not finite";
pub const corrupt_switch = "switch on corrupt value";
pub const shift_rhs_too_big = "shift amount is greater than the type size";
pub const invalid_enum_value = "invalid enum value";
Expand Down
4 changes: 2 additions & 2 deletions lib/std/zig/Parse.zig
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ pub fn findUnmatchedParen(gpa: Allocator, token_tags: []const Token.Tag) !?Token

for (token_tags, 0..) |t, i| {
switch (t) {
.l_paren, .l_brace, .l_bracket => try stack.append(.{.tag = t, .idx = @intCast(i)}),
.l_paren, .l_brace, .l_bracket => try stack.append(.{ .tag = t, .idx = @intCast(i) }),
.r_paren, .r_brace, .r_bracket => {
if (stack.items.len == 0 or !parenMatch(stack.pop().tag, t))
return @intCast(i);
},
else => {}
else => {},
}
}
if (stack.items.len > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const std = @import("std");

pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
_ = stack_trace;
if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
if (std.mem.eql(u8, message, "integer part of floating point value out of bounds or not finite")) {
std.process.exit(0);
}
std.process.exit(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const std = @import("std");

pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
_ = stack_trace;
if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
if (std.mem.eql(u8, message, "integer part of floating point value out of bounds or not finite")) {
std.process.exit(0);
}
std.process.exit(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const std = @import("std");

pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
_ = stack_trace;
if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) {
if (std.mem.eql(u8, message, "integer part of floating point value out of bounds or not finite")) {
std.process.exit(0);
}
std.process.exit(1);
Expand Down
2 changes: 0 additions & 2 deletions test/compile_errors.zig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
});
}


{
const case = ctx.obj("unmatched parentheses", b.graph.host);

Expand All @@ -74,7 +73,6 @@ pub fn addCases(ctx: *Cases, b: *std.Build) !void {
":3:1: error: unmatched curly brace",
":2:2: error: expected 'EOF', found '}'",
});

}

{
Expand Down

0 comments on commit 88b104a

Please sign in to comment.