mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 22:33:08 +00:00
commit
ac1b0e832b
@ -9403,7 +9403,7 @@ fn List(comptime T: type) type {
|
|||||||
Unlike for {#syntax#}@breakpoint(){#endsyntax#}, execution does not continue after this point.
|
Unlike for {#syntax#}@breakpoint(){#endsyntax#}, execution does not continue after this point.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
This function is only valid within function scope.
|
Outside function scope, this builtin causes a compile error.
|
||||||
</p>
|
</p>
|
||||||
{#see_also|@breakpoint#}
|
{#see_also|@breakpoint#}
|
||||||
{#header_close#}
|
{#header_close#}
|
||||||
|
|||||||
@ -575,21 +575,11 @@ pub fn abort() noreturn {
|
|||||||
raise(SIG.KILL) catch {};
|
raise(SIG.KILL) catch {};
|
||||||
exit(127); // Pid 1 might not be signalled in some containers.
|
exit(127); // Pid 1 might not be signalled in some containers.
|
||||||
}
|
}
|
||||||
if (builtin.os.tag == .uefi) {
|
switch (builtin.os.tag) {
|
||||||
exit(0); // TODO choose appropriate exit code
|
.uefi, .wasi, .cuda => @trap(),
|
||||||
|
else => system.abort(),
|
||||||
}
|
}
|
||||||
if (builtin.os.tag == .wasi) {
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
if (builtin.os.tag == .cuda) {
|
|
||||||
// TODO: introduce `@trap` instead of abusing https://github.com/ziglang/zig/issues/2291
|
|
||||||
@"llvm.trap"();
|
|
||||||
}
|
|
||||||
|
|
||||||
system.abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
extern fn @"llvm.trap"() noreturn;
|
|
||||||
|
|
||||||
pub const RaiseError = UnexpectedError;
|
pub const RaiseError = UnexpectedError;
|
||||||
|
|
||||||
|
|||||||
@ -193,7 +193,7 @@ typedef char bool;
|
|||||||
#elif defined(__i386__) || defined(__x86_64__)
|
#elif defined(__i386__) || defined(__x86_64__)
|
||||||
#define zig_trap() __asm__ volatile("ud2");
|
#define zig_trap() __asm__ volatile("ud2");
|
||||||
#else
|
#else
|
||||||
#define zig_trap() raise(SIGILL)
|
#define zig_trap() raise(SIGTRAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if zig_has_builtin(debugtrap)
|
#if zig_has_builtin(debugtrap)
|
||||||
|
|||||||
@ -3528,6 +3528,7 @@ pub fn astGenFile(mod: *Module, file: *File) !void {
|
|||||||
const digest = hash: {
|
const digest = hash: {
|
||||||
var path_hash: Cache.HashHelper = .{};
|
var path_hash: Cache.HashHelper = .{};
|
||||||
path_hash.addBytes(build_options.version);
|
path_hash.addBytes(build_options.version);
|
||||||
|
path_hash.add(builtin.zig_backend);
|
||||||
if (!want_local_cache) {
|
if (!want_local_cache) {
|
||||||
path_hash.addOptionalBytes(file.pkg.root_src_directory.path);
|
path_hash.addOptionalBytes(file.pkg.root_src_directory.path);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8261,6 +8261,7 @@ pub const FuncGen = struct {
|
|||||||
_ = inst;
|
_ = inst;
|
||||||
const llvm_fn = self.getIntrinsic("llvm.trap", &.{});
|
const llvm_fn = self.getIntrinsic("llvm.trap", &.{});
|
||||||
_ = self.builder.buildCall(llvm_fn.globalGetValueType(), llvm_fn, undefined, 0, .Cold, .Auto, "");
|
_ = self.builder.buildCall(llvm_fn.globalGetValueType(), llvm_fn, undefined, 0, .Cold, .Auto, "");
|
||||||
|
_ = self.builder.buildUnreachable();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2757
stage1/zig.h
2757
stage1/zig.h
File diff suppressed because it is too large
Load Diff
BIN
stage1/zig1.wasm
BIN
stage1/zig1.wasm
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user