mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: support [noreturn] fn abc() { for{} }
, mark panic/1 and exit/1with it too. (#10654)
This commit is contained in:
@ -140,6 +140,7 @@ pub fn write(fd i64, buf &byte, count u64) i64 {
|
||||
return x
|
||||
}
|
||||
|
||||
[noreturn]
|
||||
fn bare_panic(msg string) {
|
||||
println('V panic' + msg)
|
||||
exit(1)
|
||||
@ -150,6 +151,7 @@ fn bare_backtrace() string {
|
||||
}
|
||||
|
||||
[export: 'exit']
|
||||
[noreturn]
|
||||
fn __exit(code int) {
|
||||
sys_exit(code)
|
||||
}
|
||||
|
@ -303,8 +303,10 @@ fn sys_execve(filename &byte, argv []&byte, envp []&byte) int {
|
||||
}
|
||||
|
||||
// 60 sys_exit
|
||||
[noreturn]
|
||||
fn sys_exit(ec int) {
|
||||
sys_call1(60, u64(ec))
|
||||
for {}
|
||||
}
|
||||
|
||||
// 102 sys_getuid
|
||||
|
Reference in New Issue
Block a user