mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.gen.c: fix calling pointer receiver on function return result (#10866)
This commit is contained in:
parent
eed4f50d8c
commit
de39bba7bd
@ -762,8 +762,13 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
|
||||
// Add `&` automatically.
|
||||
// TODO same logic in call_args()
|
||||
if !is_range_slice {
|
||||
if !node.left.is_lvalue() {
|
||||
g.write('ADDR($rec_cc_type, ')
|
||||
has_cast = true
|
||||
} else {
|
||||
g.write('&')
|
||||
}
|
||||
}
|
||||
} else if !node.receiver_type.is_ptr() && node.left_type.is_ptr() && node.name != 'str'
|
||||
&& node.from_embed_type == 0 {
|
||||
if !node.left_type.has_flag(.shared_f) {
|
||||
|
Loading…
Reference in New Issue
Block a user