mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: warn if C.m* or C.s* functions are called outside unsafe blocks (#5869)
This commit is contained in:
@ -1096,12 +1096,16 @@ pub fn (stmt Stmt) position() token.Position {
|
||||
// field table.Field.default_expr, which should be ast.Expr
|
||||
pub fn fe2ex(x table.FExpr) Expr {
|
||||
res := Expr{}
|
||||
C.memcpy(&res, &x, sizeof(Expr))
|
||||
unsafe {
|
||||
C.memcpy(&res, &x, sizeof(Expr))
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn ex2fe(x Expr) table.FExpr {
|
||||
res := table.FExpr{}
|
||||
C.memcpy(&res, &x, sizeof(table.FExpr))
|
||||
unsafe {
|
||||
C.memcpy(&res, &x, sizeof(table.FExpr))
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
Reference in New Issue
Block a user